Hello! Im trying to make a go kart in roblox Studio
The Issue is when I put a driving script I found on the Go Kart It didnt move the car at all, The car Is Unanchored which confuses me more
Script
-- Variables
local VehicleSeat = script.Parent:WaitForChild("VehicleSeat")
local BackWheels = script.Parent:WaitForChild("BackWheels")
local Steering = script.Parent:WaitForChild("Steering")
-- Configure
local maxSpeed = 50
local turnAngle = 15 -- put the angle too much will cause problems
local function updateCar(property)
if property == "Steer" then
Steering.MotorTurn.HingeConstraint.TargetAngle = -turnAngle * VehicleSeat.Steer
end
if property == "Throttle" then
for _, hinges in pairs(BackWheels:GetDescendants()) do
if hinges:IsA("HingeConstraint") then
hinges.AngularVelocity = -maxSpeed * VehicleSeat.Throttle
end
end
end
end
VehicleSeat.Changed:Connect(updateCar)