A question about Spline and Physics!

Hi! I want to make a physics cart that goes along a spline, I tried something but it doesn’t work. What I want is to be able to push the cart and have it follow the spline, without tipping it over or taking it off the spline, just being able to push it forward and back on the spline.



Do you know how I can do that?

The GetActorLocation node is a bit questionable? :slight_smile:

Why not interp the location and rotation to the spline, but quite gently ( 3 or less ) to give the physics time to react.

How about ‘find location closest to world location’ ( or transform )?

1 Like

hmm, I don’t know how this should look in BP

This code would go in the cart BP, very rough concept

1 Like

I tried, with the setting of the actor it doesn’t work because the rest of the components are linked to a physics static mesh (Base).
I thought that I don’t need to set the location of the cart because I need it to be able to be pushed through physics. So, I figured the Z rotation should be fine, as if the cart was hanging on splines. I didn’t manage to solve it either, I tried something but I can’t push the card…


I don’t understand why it’s so hard to get something like this out. i want something like you have a string and a ball with a hole in it and the ball follows the string through physics… maybe it’s possible but I don’t understand how it can be done

Yeah… physics, that’s the problem. It’s very all or nothing.

You may be able to set some sort of transform ‘constraint’, but I have no idea how…

Why not just turn it off while you’re on the spline?

1 Like

because I want to be able to push it manually

1 Like

Yes, still allow the pushing, but use the distance along spline and rotation to control it.

Use an overlap or something like that?

I was thinking about this.

Let’s just look at location first. You can subtract the cart location from the location it should be at on the spline, which will give you a direction vector. Reverse this ( *-1 ) and add force to the cart.

Does that do anything useful?

1 Like

Im definitely trying this out on my project. Thank you for your input