I tried to script my very first car today after building it and i got this error : Workspace.Car.DriverSeat.VehicleSeat.Script:14: attempt to perform arithmetic (unm) on Instance
The script:
local leftwheelF = script.Parent.Parent.Parent.LeftWheelF
local leftwheelB = script.Parent.Parent.Parent.LeftWheelB
local rightwheelF = script.Parent.Parent.Parent.RightWheelF
local rightwheelB = script.Parent.Parent.Parent.RightWheelB
local steer = rightwheelB.Parent.Steer
local speed = 80
script.Parent.Changed:Connect(function(proprety)
leftwheelF.AngularVelocity = speed * script.Parent.Throttle
leftwheelB.AngularVelocity = speed * script.Parent.Throttle
rightwheelB.AngularVelocity = speed * -script.Parent.Throttle
rightwheelF.AngularVelocity = speed * -script.Parent.Throttle
steer.TargetAngle = 15 * -script.Parent.Parent.Parent.Steer
end)
I don’t know if im doing something right or not and i don’t understand the error as i have no experience with hinges and vehicle seats, i tried to look upon that tutorial for the script but i feel like it’s outdated or maybe the car model (that i built myself) doesnt fit the structure for the script to work well?
I checked if everything is parented correctly and i don’t see any issue
If i did something wrong and you know how to fix this please let me know, and if you think that the script doesnt fit the car and i should look upon another tutorial and learn from other ressources then please let me know as well i never scripted a car before