Movement along the spline

Hello,
I am looking for some guidance on how I should approach implementing spline scrubber/movement.

What I am trying to achieve is:

I want my animated target to follow a spline based on a root motion delta position (I have a walk animation that moves my character forward thus I can obtain the delta position.

I don’t mind having a separate AnimationTrack present that will drive the actual animation and blending, etc. since it isn’t straightforward to extend AnimationTrack and related classes.

So my question is:

  • how should I set the position and rotation of the Animator’s GameObject? (i can handle all the required calculations)
  • what should I do to allow this to be previewable as regular animations when working with the timeline?

I would appreciate some info. I’ve searched the forums, the internet, existing opensource packages (GitHub - fx-lange/unity-spline-scrubber: Unity Timeline integration for the Unity Spline package utilizing c# job system and burst compiler), and paid assets (https://assetstore.unity.com/packages/tools/animation/b-spline-path-105412) and didn’t found anything that will work correctly.

1 Like

Hi, I‘m the developer behind spline scrubber and just stumbled upon your post. It’s true that spline scrubber doesn’t support your approach. What it allows to do is the other way around:

Instead of the root motion driving the movement on the spline you could use the speed/delta from spline+timeline to drive the animation (develop branch).

I guess as long as root motion delta is ~constant it could be close enough.