This is my first actual car I am creating and I did get the car to move but when I start trying to steer it the wheels get all wobbly and when I press only “W” to make the car move foward it moves foward at the same time it moves left. Here is the video:
robloxapp-20210528-0008409.wmv (3.2 MB) (Sorry u dont have to see it)
local script:
local car = script:WaitForChild("Car").Value
local seat = car.Chassis.VehicleSeat
local motor1 = car.Chassis.Platform.MotorFR
local motor2 = car.Chassis.Platform.MotorFL
local Attachment1 = car.Chassis.Wheel2.WheelFR.Attachment1
local Attachment2 = car.Chassis.Wheel1.WheelFL.Attachment1
local maxspeed = 30
local steerAngle = 30
local torque = 0
seat.Changed:Connect(function(property)--Getting the property that has changed
if property == "Steer" then
--Steer
local steerGoal = Vector3.new(0,steerAngle * seat.steer,0)
Attachment1.Orientation = Vector3.new(steerGoal)
Attachment2.Orientation = Vector3.new(-steerGoal)
elseif property == "Throttle" then
--Throttle
torque = seat.Torque
local throttle = seat.Throttle
throttle = (maxspeed * throttle) * torque
motor1.AngularVelocity = -throttle
motor2.AngularVelocity = throttle
end
end)