Posts: 5
Threads: 3
Joined: Nov 2015
I am simply trying to set the SplineController position (along the spline) from code. I want to be able to control it with a 0-1 value. I thought that this would work, but it doesn't:
splineController.Position = moveValue;
there is no error, it just doesn't do anything. The spline variable is set properly. I've tried changing the move mode and position mode and nothing works, please help
Posts: 690
Threads: 71
Joined: Jan 2015
This should work. Note that setting Position (or RelativePosition) works only if the controller is running! If not running, use InitialPosition!
Posts: 5
Threads: 3
Joined: Nov 2015
I finally fixed it, I found that I had to adjust the animation settings to:
splineController.MoveMode = CurvyController.MoveModeEnum.Relative;
splineController.Speed = .1f;
splineController.Clamping = CurvyClamping.Clamp;
splineController.PlayAutomatically = true;
splineController.AdaptOnChange = true;
splineController.Animate = false;
It's a little unintuitive that I had to set the animation settings like that. The connection to setting the position in script is not clear. I would prefer a toggle like "SetPositionFromScript" or something like that
Posts: 690
Threads: 71
Joined: Jan 2015
The important line above is "MoveMode", because Position is set according to that mode. If you want to set relative position regardless of MoveMode, use "RelativePosition"!