I’m currently trying to re-make my car script and i’m having issues with the velocity of the car,
I’m trying to make it be able to move backward and forward and also move in the front / backward direction of the car.
This is what i have so far:
local LookVector = -Chassis.CFrame.LookVector
local Throttle = DriveSeat.Throttle
local Steer = DriveSeat.Steer
local Acceleration = LookVector * (CarConfig.Acceleration * step) * Throttle
if Chassis.Velocity.Magnitude < CarConfig.MaxSpeed then
Chassis.Velocity += Acceleration
end
local x = math.clamp((Chassis.Velocity.Magnitude / ((CarConfig.MaxSpeed * 1.2) / 2)), 0, 1)
local TurnFactor = math.sin(x * math.pi)
if (Chassis.RotVelocity.Magnitude / CarConfig.TurnSpeed) < TurnFactor then
local y = -Steer * TurnFactor * CarConfig.TurnAcceleration * step
Chassis.RotVelocity += Vector3.new(0,y,0)
end
Here’s what i mean: https://gyazo.com/21d5ca5edf59b3620059fcef86adaae9
The problem with this is, it makes the car almost slide on the surface it’s on, the car doesn’t move forward relative to how it’s faced and it makes it look like the car has no grip, any help / articles would be appreciated