01-18-2018, 02:41 PM
(01-18-2018, 04:19 AM)hawken Wrote: Thanks I changed to a relative position and went from there, works nicely however in the end I had to make it a coroutine and do a while loop to make it / force it to go to the place I wanted, seems sometimes spline controllers go to 0... took about 5~10 frames before it went to the correct position.
This seems overly complicated.
Here is a simple way to do the switch:
Code:
if (splineController.Spline == Spline1)
splineController.Spline = Spline2;
else
splineController.Spline = Spline1;
splineController.RelativePosition = 0.5f;
//Uncomment this if your splineController has PlayAutomatically set to false
//splineController.Play();
I also attached a scene with this code in a script. You just have to click or press any button in playmode to operate the switch
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.