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
  How to get length starting from one spline to connected nth spline Dragon-3623 1 1 05-14-2024, 04:52 PM
Last Post: _Aka_
  Set Volume to the Volume Controller at Runtime pako88 2 10 04-08-2024, 03:26 PM
Last Post: _Aka_
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 6 03-28-2024, 10:08 PM
Last Post: _Aka_

Forum Jump: