Posts: 3
Threads: 1
Joined: Dec 2018
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.
Posts: 2,142
Threads: 95
Joined: Jun 2017
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 helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Posts: 3
Threads: 1
Joined: Dec 2018
12-19-2018, 10:31 PM
(This post was last modified: 12-19-2018, 10:37 PM by gtpdz.)
(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.
Posts: 2,142
Threads: 95
Joined: Jun 2017
Thanks. I will keep you updated
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Posts: 2,142
Threads: 95
Joined: Jun 2017
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 helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Posts: 3
Threads: 1
Joined: Dec 2018
(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!
Posts: 3
Threads: 0
Joined: Apr 2020
(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!
Posts: 2,142
Threads: 95
Joined: Jun 2017
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 helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Posts: 3
Threads: 0
Joined: Apr 2020
(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.
Posts: 2,142
Threads: 95
Joined: Jun 2017
It happens
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
|