06-21-2023, 05:29 PM
Hi, I've been trying to go through your tutorials and documentation, but it's a little overwhelming for me trying to find how to do this.
I "draw" a spline at runtime, then instantiate an object (that already has an empty SplineController component attached). I need to find a way to Add the newly created CurvySpline to the Object's Spline Controller component then start the position "movement" of it along the spline.
This is what I tried to add the spline to the instatiated object's SplineController, but doesn't seem to work.
As for starting the animation of the object moving along the spline, and controlling it's speed, I'm really not sure where to even start.
As a bonus question, is there an easy way to get the First point's world position on a new spline? Similar to
I "draw" a spline at runtime, then instantiate an object (that already has an empty SplineController component attached). I need to find a way to Add the newly created CurvySpline to the Object's Spline Controller component then start the position "movement" of it along the spline.
This is what I tried to add the spline to the instatiated object's SplineController, but doesn't seem to work.
Code:
MyObject.GetComponent<SplineController>().Spline = MyNewSpline.GetComponent<CurvySpline>();
As for starting the animation of the object moving along the spline, and controlling it's speed, I'm really not sure where to even start.
As a bonus question, is there an easy way to get the First point's world position on a new spline? Similar to
Code:
CurvySpline.GetNearestPoint()