Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using timeline to manually animate curvy position.
#1
This is a great asset for creating spline and animate object along them, however when using curvy combined with Unity Timeline and Cinemachine, when the object position is updated via timeline key frame along the spline, the cinemachine camera is never smooth when the timeline is played. 

Suspecting manually update the object's position via timeline has a bit of delay. Does anyone find a work around? Thanks in advance.
Reply
#2
Hi,
Do you have a simple reproduction project/scene to share with me so I can analyze properly this situation?
Thanks
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
(12-19-2018, 11:07 AM)_Aka_ Wrote: Hi,
Do you have a simple reproduction project/scene to share with me so I can analyze properly this situation?
Thanks

Here is the scene:

Google Drive Link

It has a cube that follows the spline with key framed spline position and a cube that does simple unity position key framed animation, both followed by a cinemachine camera.

Noticed the jittery motion in the first cube, which seems gets worse when played in timeline mode.

Update: I do noticed that this jittery motion is gone when setting the spline controller mode to Late Update + use cache, any other mode will still result in the jittery.
Reply
#4
Thanks. I will keep you updated
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#5
Ok, I found an explanation for the issue, and have a solution for you

The explanation:

It all boils down to a difference in the frame rate at which the object moves vs the one at which the camera is updated. When these two rates are irregular, you will notice in some frames that the camera moved but not the object, which creates the jittering feeling.
You need to know that when you edit the "Position" property through an animation, the object does not actually move until the SplineController script is updated. The update happens in Play mode at the method specified by the "Update In" field, and in edit mode it happens when Unity's callback "EditorApplication.update" is triggered

To better explain the issue, I will subdivide the issue in two:
  • In play mode: In your project, your controller is updated in Fixed Update. In your project, this means at 50 FPS. The game renders at a different and higher frame rate, so this leads to having situations where the object does not move between two rendering frames, which creates the jittering. Like you found yourself, setting the object to move in Late Update solves the issue. Setting Use Cache to true does not influence that, at least in my experience.
  • In edit mode (timeline preview): this is where the issue is the worst. This is because Unity triggers EditorApplication.update at a very irregular rate.

The solution:
  • In play mode: you found the solution already
  • In edit mode: make the controller update more frequently. There is surely a smart way to do it, which I will try to include in the next update, but for now, here is the overkill solution: Update whenever possible. I will send you via PM a modified version of the controller, that don't have the "Update In" field, and instead updates all the time.
I hope this helped

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
#6
(12-20-2018, 12:30 PM)_Aka_ Wrote: Ok, I found an explanation for the issue, and have a solution for you

The explanation:

It all boils down to a difference in the frame rate at which the object moves vs the one at which the camera is updated. When these two rates are irregular, you will notice in some frames that the camera moved but not the object, which creates the jittering feeling.
You need to know that when you edit the "Position" property through an animation, the object does not actually move until the SplineController script is updated. The update happens in Play mode at the method specified by the "Update In" field, and in edit mode it happens when Unity's callback "EditorApplication.update" is triggered

To better explain the issue, I will subdivide the issue in two:
  • In play mode: In your project, your controller is updated in Fixed Update. In your project, this means at 50 FPS. The game renders at a different and higher frame rate, so this leads to having situations where the object does not move between two rendering frames, which creates the jittering. Like you found yourself, setting the object to move in Late Update solves the issue. Setting Use Cache to true does not influence that, at least in my experience.
  • In edit mode (timeline preview): this is where the issue is the worst. This is because Unity triggers EditorApplication.update at a very irregular rate.

The solution:
  • In play mode: you found the solution already
  • In edit mode: make the controller update more frequently. There is surely a smart way to do it, which I will try to include in the next update, but for now, here is the overkill solution: Update whenever possible. I will send you via PM a modified version of the controller, that don't have the "Update In" field, and instead updates all the time.
I hope this helped

Have a nice day

Thanks a lot! I will take a look at the controller, really appreciate for the quick and detailed response!  Heart
Reply
#7
(12-20-2018, 12:30 PM)_Aka_ Wrote: Ok, I found an explanation for the issue, and have a solution for you

The explanation:

It all boils down to a difference in the frame rate at which the object moves vs the one at which the camera is updated. When these two rates are irregular, you will notice in some frames that the camera moved but not the object, which creates the jittering feeling.
You need to know that when you edit the "Position" property through an animation, the object does not actually move until the SplineController script is updated. The update happens in Play mode at the method specified by the "Update In" field, and in edit mode it happens when Unity's callback "EditorApplication.update" is triggered

To better explain the issue, I will subdivide the issue in two:
  • In play mode: In your project, your controller is updated in Fixed Update. In your project, this means at 50 FPS. The game renders at a different and higher frame rate, so this leads to having situations where the object does not move between two rendering frames, which creates the jittering. Like you found yourself, setting the object to move in Late Update solves the issue. Setting Use Cache to true does not influence that, at least in my experience.
  • In edit mode (timeline preview): this is where the issue is the worst. This is because Unity triggers EditorApplication.update at a very irregular rate.

The solution:
  • In play mode: you found the solution already
  • In edit mode: make the controller update more frequently. There is surely a smart way to do it, which I will try to include in the next update, but for now, here is the overkill solution: Update whenever possible. I will send you via PM a modified version of the controller, that don't have the "Update In" field, and instead updates all the time.
I hope this helped

Have a nice day

Tried using the fix found in this thread, but it's a few years old at this point and didn't know what has been fixed. In the advanced settings of the curvy spline i changed update in to late update, assuming that's what was meant by "spline controller mode to Late Update + use cache". Didn't see anything about use cache though. Even though you said that shouldn't effect anything.

 I'm using curvy 6.1 i believe and unity 2019.3. I'm getting all kind of while animating a vehicle on a spline while using and animation layer in timeline. 

Any new help on how to get rid of the jitter would be great!
Reply
#8
Yeah, that solution is not relevant anymore with current Curvy version. Try update Curvy to the latest version, and if the issue persists, please send me a reproduction case
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
#9
(04-17-2020, 07:17 PM)_Aka_ Wrote: Yeah, that solution is not relevant anymore with current Curvy version. Try update Curvy to the latest version, and if the issue persists, please send me a reproduction case
Have a nice day

I was trying to update the spline, not the spline controller. That was on me.
Reply
#10
It happens Smile
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
  snap to the curve created by the curvy splines segment points ShiroeYamamoto 1 2 8 hours ago
Last Post: _Aka_
  Curvy Line Renderer for UI Spline? gekido 1 1 8 hours ago
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 2 8 hours ago
Last Post: _Aka_
Exclamation Extending Curvy Generator for Advanced Lofting - Feasibility Check amutp 2 4 03-27-2024, 07:25 AM
Last Post: amutp

Forum Jump: