Methods of moving a car?

What is the best method of moving a car? Bodymovers? Vectorforces? Assuming this is a 100% scripted car.

1 Like

You could use these. Another alternative would be using the Hinges to make Motors and Servos to turn and rotate the wheels. Make sure to set the front wheels’ friction high so it can rotate the car.


This is an example.

image

2 Likes

No no no, my car is 100% scripted i don’t use constraints.

1 Like

I mean using scripts to start and stop the motors. Sorry if I was being unclear. You can use the AngularVelocity property to rotate the rotate the part.

Ex.

My car is just a hovercar but with wheels, it uses only vector forces right now. I am looking for a method to move the car without using any constraints.

Use Motors for moving a car without the constraints if thats what you are looking for.

Instance.new("Motor")

and I am sure you should figure it out.

Also some other help,

https://developer.roblox.com/en-us/api-reference/class/Motor

I personally think this is a good method.

If you want it 100% scripted, no BodyMovers or Constraints, you will want to use CFrame and ContextActionService.

You can use Raycasting, sent from below the vehicle, to detect how far away from the ground it is and then prevent movement when the ray hits an object.

I don’t think you guys understood, my car currently has suspensions consisting of vector forces which forces are calculated through script.

And i am trying to find the best way to move it.

I cannot use motors or constraints because it’s literally floating.

BodyVelocity would probably work then.

It applies a constant force in a specific direction. If you apply a lookvector to the Velocity property, it will move in that direction. And if you multiply that lookvector by any number, it will go at that speed.

However, BodyVelocity doesn’t act properly with some other BodyMovers. It it might be better to use BodyForce or BodyThrust, which are similar but use different methods of movement.

One important distinction is that BodyVelocity does not really take into effect the mass of an object, whereas BodyThrust and BodyForce do.

Your needs may vary depending on your suspension system. You will also want to be aware of the “Massless” property on connected BaseParts in your vehicle’s assembly if you use Thrust and Force.

I’ve tried to move it using vector forces but struggle to calculate the amount of force needed to move it.

It’s a lot. I would say try 1million, and then scale it back from there if it actually moves, even at an incredibly insane speed.

One thing that might help you, is that in order to apply force to something, you have to start by applying enough force relative to it’s mass.

Also, an object that is round will obviously move more easily than an object that is square. At least, when it comes to force and thrust.

1 Like

Currently i have an upwards force from the scripted suspension, but if i set the X axis force to the weight it just goes too fast (literally disappears).

Try calculating the mass and multiply it by workspace.Gravity to start.

Yes i have, that is my weight of the whole car.

The gravity being applied is actually (0, Y, 0) with Y being the gravity setting. It doesn’t get applied to the other axis (X or Z) so multiplying the mass by gravity when applying force to the X or Z is a bad idea.

I would say use the mass when adjusting X or Z Force, but do not use the gravity.