My car is very slow at accelerating, it is realistic, but I do not want it to be like that, Ive read about VectorForce and it maybe the solution, I just dont know how to implement it into my current Car Functionality Script.
Current Script:
local runService = game:GetService("RunService")
local MAX_SPEED = 120
local MAX_STEER = 30
local car = script.Parent
local driveSeat = car.DriveSeat
local WHEEL_RADIUS = 2.6 / 2
local SOUND_MIN_SPEED = 0.6
local SOUND_MAX_SPEED = 1.5
local SOUND_MAX_VELOCITY = MAX_SPEED * WHEEL_RADIUS
local chassis = script.Parent.Chassis
local sound = chassis:FindFirstChild("EngineSound")
local rightMotor = car.RightMotor
local leftMotor = car.LeftMotor
local rightServo = car.RightServo
local leftServo = car.LeftServo
if sound then
driveSeat:GetPropertyChangedSignal("Occupant"):Connect(function()
if driveSeat.Occupant then
sound:Play()
else
sound:Stop()
end
end)
runService.Heartbeat:Connect(function()
local speed = math.abs(chassis.CFrame.LookVector:Dot(chassis.AssemblyLinearVelocity))
sound.PlaybackSpeed = SOUND_MIN_SPEED + (SOUND_MAX_SPEED - SOUND_MIN_SPEED) * math.min(speed / SOUND_MAX_VELOCITY, 1)
end)
end
driveSeat.Changed:Connect(function(property)
if property == "ThrottleFloat" then
leftMotor.AngularVelocity = MAX_SPEED * driveSeat.ThrottleFloat
rightMotor.AngularVelocity = MAX_SPEED * driveSeat.ThrottleFloat
elseif property == "SteerFloat" then
leftServo.TargetAngle = MAX_STEER * driveSeat.SteerFloat
rightServo.TargetAngle = MAX_STEER * driveSeat.SteerFloat
end
end)
Any help would be needed