How to use spline points to drive the motion of an object?

Hello everyone!

I´m posting this to try to get help on a blueprint I’m working on at the moment, which involves the use of a spline to drive the motion of an object. The main example I followed to build the blueprint is the one on this link:

video - Unreal Engine 4 : Follow Spline Path and Detect Point Interaction - YouTube

project - Google Drive: Sign-in

Over there, you can find an example where a spline drives the motion of an object, having it stop at the points (all of them) in the spline. I’d like to change that to only stopping at a given point, for example the third point in that spline, and then after a delay in only the third stop, continue with the motion. Any idea of how I can do that? I´ve been trying to figure it out by myself all day, but I’m not that good with blueprints to manage something like this. It would also be great to modify the speed as required, since the object moves at a constant speed instead of gaining it as it moves - for example, when the object starts moving, it would be cool to gain speed as time passes, until it reaches a limit, instead of going always at a constant speed.

Any insight on how this can be achieved?

Thanks for your time reading this, any help will be extremely welcomed - I’ve been fighting with the blueprint system all day and I couldn’t find a way.

Regards!

Hi braisbr1,

You can make this change to your FollowSplinePath Event Graph and that should do it. Just disconnect the SegmentPointWait section you had in place.

I would also recommend swapping in the Get Location/Rotation at Distance Along Spline nodes. The ones you have in place are depreciated and will be removed in a future engine version.

Hope that helps.

Cheers,

TJ

Hi TJ,

thanks for your quick answer and the insight. but unfortunately after trying that solution I can’t make it work… partially. The hand starts moving, now it doesn’t stop at every single point, but it doesn’t stop at all altogether. It just goes on without stopping anywhere. Any idea of whi this might be?

Regards,

Brais

Hi again!

After spending much of the day trying it, I finally got it to work! Indeed, I had to adjust the values to get the desired result. The only problem I had so far is that if you don’t set the tolerance within a fine range, it could stop and start multiple times.

Anyway, a HUGE thank you, since I’ve spent a few good hours trying to solve this and it finally worked thanks to you.

On another note, would you know how to change the speed of that blueprint without being constant all the time? The final goal of the blueprint is to create a train, and it would be cool for the vehicle to gain speed from zero and slowly stop when it reaches the destination, instead of moving always at a constant speed.

Thanks for your help!

Try adjusting the values in the NearlyEqual(transform) node.

110559-cartstop03.png

This is the results I’m getting with my setup pictured above inside of your project.

110560-stoponsplinepoint01.gif

If it still doesn’t work, could you send a screenshot of the changes you made to the EventGraph?

Your welcome! I’m glad you got it working.

Yeah, you should be able to accomplish that with a Timeline instead of the Tick node. You would set the Float track to adjust on a curve. Not using the Tick would also give you more freedom on starting and stopping the train.