Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calling Update with defined deltatime
#1
Hey Aka,

hope you are fine.
I have a SplineController component on my GameObject which handles the spline movement which is fine, I calculate the speed of my object and it the controller sets the object to the right position and cares about events, etc.
I know that I can set when the updating should be handled, Update, LateUpdate and FixedUpdate, but that's not exactly what I need.
I am working on a multiplayer game and I need to call Update manually, but with a defined timeframe. The splinecomponent update probably does something like position+=speed*time.deltatime. But I need to calculate the position for interpolation between different snapshots I receive from the server, so instead of time.deltatime I need to set the delta time by my own. Is there a way to do this with the controller?
I know that I can do the calculation by my own and calc the position instead of the controller, but then I need to handle all the other stuff by my own as well.. like the behavior at spline end, events, etc.. So if it's possible I would like to avoid doing everything by my own.

Best regards,
Marco
Reply
#2
Hi
Please check the documentation, and if possible the code, of the following methods. At least one of them should be useful to you.
CurvyController.Advance
CurvyController.SimulateAdvance
CurvyController.ApplyDeltaTime
To disable the automatic update, please add another value to CurvyUpdateMethod, for example CurvyUpdateMethod.None, and use it. Checking the Update, LateUpdate and FixedUpdate of CurvyController should help you understand what I mean.
Did this help?
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
(01-25-2023, 12:17 PM)_Aka_ Wrote: Hi
Please check the documentation, and if possible the code, of the following methods. At least one of them should be useful to you.
CurvyController.Advance
CurvyController.SimulateAdvance
CurvyController.ApplyDeltaTime
To disable the automatic update, please add another value to CurvyUpdateMethod, for example CurvyUpdateMethod.None, and use it. Checking the Update, LateUpdate and FixedUpdate of CurvyController should help you understand what I mean.
Did this help?

This sounds exactly like what I need.. I will check this. Thank you very much, I read the docs so often but I didn't remember these ones. Thank you very much!
Marco
Reply
#4
You are welcome. Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  I want SetLocalPositions to update all CPs at once. yanke 3 5 05-30-2022, 02:50 PM
Last Post: _Aka_
  Update - Which folder to delete Marco Schultz 3 8 04-26-2022, 05:00 PM
Last Post: _Aka_
  CurvyConnection Update Overhead wingednosering 10 917 10-13-2021, 05:23 PM
Last Post: _Aka_
  Error: Calling TeleportBy on a controller that is stopped jamesunity 5 2,672 07-13-2020, 12:28 PM
Last Post: _Aka_

Forum Jump: