Need help with splines....(Can i do this somehow)

So here’s my question.

I want 1 spline blueprint with a variable inside it called “Route” set as an integer and editable (So i can change the Int number when placed into the level). I will have multiple splines in the level and all spline paths will have a different Int number corresponding to their route.

When route 1 is pressed in the starting widget, it goes to the player controller and starts moving the car along the route 1 spline. Then at the end of that route another widget opens and more routes become available.

But when i click route 2 or 3 or 4, it just plays route 1 again. How should I be setting up the blueprint inside the player controller to tell the car to follow the correct spline when the corresponding route button is pressed.

-OR-

Should I be using an array of the spline where route 1 is spline array 0 and route 2 is spline array 1 and so forth. If this is the correct way, how do I set that up?

You can use a Map or Array for this.


  • create a Splines array in the Player Controller
  • in the Level Blueprint, on BeginPlay make an orderly array out of the splines
  • cast to the PC and set the Splines variable

The PC now has all the references to splines in your level. (if you ever load another level with different splines, it will still work fine)

Move the car along Splines->Get[0] and then switch Splines->Get[x].


Or you can ignore the Level Blueprint and use a Map, like so:

Thanks for the idea mate. I got it sorted where i use only 1 spline blueprint throughout the level and in the player control I just get the class ID and assign a timeline to each spline track :slight_smile: