How to move a part along it's individual axis?

Hi,

I’m trying to make a cart ride game and add some movement to the cart by using a LinearVelocity instance. However, i can’t hardcode it’s velocity because of the turns and hills, etc.

How can i apply velocity on only the x axis for example, in the direction the part is facing?

Thanks in advance!

1 Like

Change Mode.RelativeTo to Attachment0 and set the Attachment0 to an attachment where its x is facing the front direction of the cart
So then the force will be relative to where the attachments facing

2 Likes

Hey, that solved the direction yea, but now after 10 or 20 studs it goes kinda up and starts spinning around. I assume because the RelativeTo mode also follows orientation. I basically just need to move forward in the way it’s facing.

im not touching that with a 20 foot pole because i stopped understanding the moment it started flipping

Why are you using a force? You should be using hinge constraints. Just set their ActuatorType to Motor, and you can use a script to set it’s AngularVelocity using VehicleSeat.Throttle.

This is definetly leaning more towards the desired result, but it’s just spinning around all the time right now.

This video on how to make cars with Hinge Constraints by Roblox might help.
Making a Car: VehicleSeat - YouTube

Ensure the wheel constraints are the right way around or multiply the AngularVelocity values by -1 where necessary.

1 Like