Turning HoverCars!

I’m making this Hover Car and I’m stuck at turning the vehicle.

Using BodyAngularVelocity Works fine, but looks awful(see gif below)

So I need to probably change whole way of approaching this and hope that I will gt some help as well. What BodyMover should I use or maybe I don’t need bodyMovers at all and CFraming is enough.

Thanks in advance.

4 Likes

What properties are you currently using (for the bodyAngularVelocity)? Tweaking them will give a different result.

Also, by looking awful, what do you exactly mean? Does it spin too fast? Is it jittery? What exactly is your problem?

Properties are:
5fb8a7055bcf9ba29c3e8fde470a96b6

and for turning I’m doing this:

if seat.Steer == 1 then
		
   rotate.AngularVelocity = Vector3.new(0,-40,0)

end

By looking awful, I mean that it doesn’t look realistic, good and cool. Also, it continues
spinning for some time after I set it zero

if seat.Steer == 0 then

	rotate.AngularVelocity = Vector3.new(0,0,0)
		
end	

and if you compare it with Cars in this place, yes, it really looks awful

You could try using a bodygyro or something to make the car tilt slightly when turning, making it look better.

I tried but it didn’t work, I have everything welded to the main white part in the middle, when I tilt it it doesn’t tilt because I suppose suspension is not allowing it

You could use lerp

— loop
BodyAngularVelocity.AngularVelocity = BodyAngularVelocity.AngularVelocity:Lerp(Vector3.new(0 , -40 * Steer , 0) , 0.1)

Same result, it looks same.

My main issue with handling turning like this is that it looks generic and artificial

You can then use trigonometry to adjust the suspension if you like, or have only one bodymover in the middle and use a gyro to control rotation.

1 Like

Some ideas :slight_smile:

The car is rotating with a fixed velocity as you’re not taking an acceleration into account. It’s unrealistic for a car’s rotation to instantly achieve its maximum value, and you might find including an acceleration into the calculation for how fast the car spins does the trick!

Secondly, the camera isn’t really following your car - this doesn’t feel so good as a player. Notice how in Hovercar Experiments, pressing A and D causes the camera to follow the car in a really nice smooth manner. Camerawork is essential for an immersive experience, after all.

Finally, you’ll probably find you want particle emitters to really give off the vibe of “I’m turning”. I’ll leave that one entirely up to your creative discretion, but it’ll make all the difference.

I hope this helps!

1 Like

Thank you, I will try them out.

Use a Torque constraint! If you put this inside your vehicles main loop, you should get good turning behaviour:

TURNING_STIFFNESS = 100 --How quickly the car accelerates into a turn
TURNING_SPEED = 10 --The max speed a car turns

local AngVel = Car.Base.CFrame:VectorToObjectSpace(Car.Base.RotVelocity).Y --Assuming the base of the car has it's Y axis as vertical

local TurningTorque = TurningInput * TURNING_STIFFNESS - AngVel * (TURNING_STIFFNESS / TURNING_SPEED)
TorqueContraint.Torque = Vector3.new(0, TurningTorque, 0)

Main downside is that if you set TURNING_STIFFNESS too high, the car may glitch out when the framerate drops

EDIT: You know what, I wrote all that out then decided, actually, this is pretty much a worse version of what BodyAngularVelocity does, although how it works and what the properties do is more transparent.

1 Like

I was thinking of using CFrames with bodyGyro, but I don’t know how to get them work without messing up suspension