Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spline Controller Position Force Update ?
Hello Smile

I am changing the Position of the Spline Controller every frame (I have Absolute position).
I have a spline not closed, with let's say 600,5 of distance.

When I want to activate my SplineController, I set the Position to 0, but Even if the position is set to 0, I have One frame where the SplineController is not at the right position (in the next frame, and all other frame, the position is good).

[Image: IEqjRvrvSMe_curv.PNG]

It's happen in one particularte case:
- My SplineController is at 600,5 (the end of the spline)
- I desactivate my Spline and my SPlineController.
- After a while, in the same frame: I want to reactivate the Spline AND the SplineController, and set the SplineController to the position 0. And then, even if the value is set to 0, the position of the transform seems to be still at 600,5. The next frame, the position & value are good.

I think that even if I do SplineController.Position = 0; I would like to tell the SplineController something like RefreshPosition or something.

2) And a little other things: How can I tell the Position to be at the Maximum ? (my 600,5 value ?)
Of course, I can Set my SplineController.Position at _curvySpline.Length. But when I do that, the position is set to 0, and not 600,5. 
I have managed do do that:
SplineController.Position = _curvySpline.Length - 0.1f;
Then I have a Position of 600,4, but it's not precise.
1) To force update the controller, call its Refresh method
2) Change Clamping to Clamp instead of Loop, then set position to spline.Length. Read this documentation for a better understanding of clamping and other properties of controllers:
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.

Possibly Related Threads...
Thread Author Replies Views Last Post
  Spline events not working in IL2CPP build (Android) callen_mrez 4 19 Yesterday, 05:45 PM
Last Post: _Aka_
  Disable the Update of the CurvySpline UsernameHed 6 88 05-22-2019, 02:28 PM
Last Post: _Aka_
  Spawning object with correct rotation at spline end arrnav96 2 28 05-21-2019, 02:19 PM
Last Post: arrnav96
  Spline Controller restart FlebusCroqus 2 29 05-16-2019, 07:35 PM
Last Post: FlebusCroqus

Forum Jump: