Unity 2022 Spline Assistance

Good Morning All,

I apologize in advance if this is the incorrect forum. I’m trying to do some very simple manipulation with Unity’s Spline package, but from what I can see, the documentation is pretty limited and I am struggling. :frowning:

I have created a Spline Container and attached a Spline Animate script to the cube.

Through script, I need to be able to:

Is anyone able to provide me an example of how to accomplish this?
Thank you so much to anyone who took the time in advance! :slight_smile:

I would start with the docs for this Spline package. I haven’t used it personally, but I assume the docs exist.

If you cannot find what you want in the docs, post a link to the docs and I’ll take a look too.

https://docs.unity3d.com/Packages/com.unity.splines@2.1/api/UnityEngine.Splines.SplineAnimate.html

1 Like

Ack, I didn’t check SplineAnimate, thanks a ton!

So, I can use Play()/Pause() to start and stop it, and Maxspeed to adjust the speed. Awesome!

That last thing I need to be able to do is find out when its reached the end of the Spline…
Would I just check “IsPlaying” to see if it’s reached the end?:face_with_spiral_eyes:

I would try checking for NormalizedTime >= 1.0f , that’s a common pattern in Unity stuff although not sure if it will work for Splines (haven’t tried it)

1 Like

This worked perfectly!