Cart falling off track!

Hey there, currently working on a cart ride type game. I have made a curved rail but for some reason the cart keeps getting stuck on it and falls off. If you know of any solutions please let me know.

2 Likes

All cart ride games are pretty generic and I also made one, this is just an issue that happens. idk really how to fix it but adding parts that wrap around the track may help it stop falling over. Anyways, cart ride games are pretty boring if they don’t fall over because at that point ur just afk on a moving platform going around an enlarged free model. So I kinda like the idea of falling over because it provides some skill aspect to your game. Goodluck on fixing that problem though, I’m sure ur cart ride game will turn out great!

2 Likes

I’m just doing it for the experience LoL. But yes, the falling is the point. I just find that its falling off the tracks too easily. Like its going pretty slow but yet it does like a stutter then kind of bugs out.

1 Like

This might sound interesting but instead of creating barriers around the tracks you can use AlignPosition instead which might sound a better-suited alternative instead of barriers.

I’m sure the cart will still move like it is in the video even with the AlignPosition constraint.

Try using TweenService to move the cart instead.

How would this theory work? It would be nice that the cart would still operate the same just a bit more balance on the turns. If this has to do with anything, I just snatched body movers (which I know are now deprecated) from a original cart and shoved them on my cart.

image
Code in Cart:

while true do
	local look = script.Parent.CFrame.lookVector*15
	script.Parent.BV.velocity = Vector3.new(look.x, -15, look.z)
	task.wait()
end

I don’t feel this would be necessary cause I still want it to function as a normal cart.
It just falls off the rails too easily.

The downforce seems way too large.

Change your code to this:

while true do
	local look = script.Parent.CFrame.LookVector * 15
	script.Parent.BV.Velocity = Vector3.new(look.x, -5, look.z)
	task.wait()
end

This didn’t seem to do anything but make it worst LoL.

1 Like

You shouldn’t be using body velocity in the first place! Use constraint wheels and add suspension to your cart (preferably) and then it should work.

If you need to keep this legacy system, use VectorForce instead of BodyVelocity and change the force to something.

put a .05 ish gap between the inner wheel and rail

I did make one with constraints but I cant get the front wheels to turn with the rail. Used cyclical and spring constraints.
image

1 Like

It still flung around and fell of the rails.

1 Like

you need to have some sort of steering for your front/back wheels.

Clearly but i’m not great with constraints so I have no idea what to do for that.

Add the cylindrical constraint on the axel base of the front wheels or something instead of prismatic.

try using balls instead of cylinders as the main wheels, invisible, while the ones on top are decoration

1 Like

Like I said above, I already am using the cylindrical constraint.

1 Like

How would I make it stay on the track?

1 Like