fx-lange / unity-spline-scrubber

Unity Timeline integration for the Unity Spline package utilizing c# job system and burst compiler
MIT License
40 stars 4 forks source link

needs documentation or an example scene #2

Open chase-rg opened 7 months ago

chase-rg commented 7 months ago

this looks very interesting, but it's not obvious how to set up a basic example.

chase-rg commented 7 months ago

I think the idea is:

First, set up the thing you want to travel along a spline:

  1. create a game object you want to move along a spline
  2. add a SplineCart component to it
  3. add a SplineClipData component to it
  4. Drag the SplineContainer you want to travel along into the SplineClipData component (SplineContainer is a thing in the Unity Spline package where you actual build your splines on to FYI)

Second, create a SplinesMoveHandler in your scene. this seems to manage all active spline animations (?)

  1. create a game object in your scene
  2. add a SplinesMoveHandler component on it

Third, set up your timeline animation

  1. in the Timeline window, add a SplineScrubber track
  2. drag your game object with the SplineCart onto the track
  3. right click in the timeline on the SplineScrubber track, and select "Add Spline Clip"
  4. select the clip on the timeline you just created and look at the inspector - you need to drag in your gameObject with the SplineClipData on it here.

Success!

I'm not sure if this is exactly what the author had in mind, but this seems to be an ok starting point.