Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Setting instantiated object to spline, then starting movement?
#1
Question 
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.  Blush

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()
Reply


Messages In This Thread
Setting instantiated object to spline, then starting movement? - by _RicO - 06-21-2023, 05:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  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_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_
  GO can't fit end of the spline GameDeveloperek4123 3 14 03-04-2024, 11:06 AM
Last Post: _Aka_

Forum Jump: