Hello I have a car which goes well on straight fields but when I drive it on a mountain it doesn’t go what do I do?
here’s the script also and I didn’t make it btw
– get the specifications
local speed = script.speed.Value
local accleration = script.acceleration.Value
local steeringspeed = script.steeringSpeed.Value
local steeringangle = script.steeringAngle.Value
– set up the shortcuts
local vehicle = script.Parent.Parent
local seat = script.Parent
– find the tires
local A = vehicle.A – front left
local AA = vehicle.AA – front right
local B = vehicle.B – back left
local BB = vehicle.BB – back right
– find the steering mechanism
local steerA = vehicle.SteeringA.Servo
local steerB = vehicle.SteeringB.Servo
– set up wheels’ motor accerlation
A.Motor.MotorMaxTorque = accleration
AA.Motor.MotorMaxTorque = accleration
B.Motor.MotorMaxTorque = accleration
BB.Motor.MotorMaxTorque = accleration
while true do
-- power the wheels
velocity = seat.Throttle * speed -- use the seat's throttle to determine the wheels' action (backward? forward? nothing?)
A.Motor.AngularVelocity = velocity
AA.Motor.AngularVelocity = velocity
B.Motor.AngularVelocity = -velocity
BB.Motor.AngularVelocity = -velocity
wait()
-- steering
steering = seat.Throttle * speed
steerA.AngularSpeed = steeringspeed
steerA.ServoMaxTorque = 100000000
steerA.TargetAngle = steeringangle*seat.Steer
steerB.AngularSpeed = steeringspeed
steerB.ServoMaxTorque = 100000000
steerB.TargetAngle = steeringangle*seat.Steer
end