How to know the exact Knot on spline the game object is on in Unity?

45 Views Asked by At

I have used Spline to animate a GameObject I want to disappear my GameObject when it is on Knot[4] and re-visible it on Knot[6]. But I don't know exactly how to do this. Is there any way to achieve this? Thanks in advance.

1

There are 1 best solutions below

0
TheNomad On BEST ANSWER

You're probably looking for SplineUtility.ConvertIndexUnit() . SplineUtility.Evaluate() might also help, depending on what you need. For real-time tracking, I don't think you can avoid the dreaded Update() way of putting if-checks there. I haven't found any runtime events, unfortunately.