Timeline or Timers? Moving an Actor Along a Spline

Lewis Murphy
Mon, 27 Jan 2025 17:13:51 +0000
Blueprint

Right so, I’m currently in the middle of a project where one of my actors (in this case, a player pawn) must move along a spline component and I’m stuck at figuring out which system I should be using.
Ultimately it either comes down to using a timeline node to set an alpha channel and lerps the actor between two vector points (I’m thinking of using the individual spline point vectors), or using a “SetTimeByFunction/SetTimerByEvent” node that calls a separate function and handles the lerp between the vectors instead.
But here’s my issue, both versions of the system in my head have one core problem.
“The Timeline” Method - I’ll have no control over the pawn as it moves across the spline, and I would like to at somepoint have control over whether or not I want it to stop half way down for another event to happen for example (e.g., move to another spline actor).
“The Timer” Method - I haven’t got the foggiest clue as to how to implement the smooth lerping transistion for the pawn across the spline using a custom method attached to the timer, but I know with this method I have control over how long (rate) it takes to fire off the delegate (e.g., every second) which helps with the game’s performance.
I prefer the timer option personally, but I’m at a loss when it comes to lerping the pawn actor along the spline with this option. I’m thinking I’d have to find the distance between each spline point, lerp the pawn between these two vectors, and continue this cycle down the spline until it reaches the last point along it, but this requires finding each individual spline points as an index and I’ve spent hours trying to figure out how to implement this and nothing seems to be working.
So there in lies my blueprint problem. Splines are complex for gathering their point data, so I’m finding all of these tutorials and “solutions” for this system where developers are using “GetDistanceAlongSplineAtSplinePoint” nodes and “GetNumberOfSplinePoints” and so forth, but none of these fit my system needs. If someone could help point me in the right direction for this problem, that’d be appreciated! If you need clarity with images or further info., just let me know. Cheers!

3 posts - 3 participants