I have a hitbox in a car which I created from this tutorial.
I have a problem though in which when my hitbox is in the car, it can’t move, the hitbox is not anchored, cancollide, etc. If I also delete the hitbox my car just breaks because it contains all my welds because for some reason my welds won’t work without it.
I’ve tried using customphysicalproperties, massless, making a new car, and thought of using free models to make my own cars but I don’t know what to do.
Car Script:
local Players = game:GetService("Players")
local ServerStorage = game:GetService("ServerStorage")
local car = script.Parent
local backLeft = car.BackLeft
local backRight = car.BackRight
local frontRight = car.FrontRight
local frontLeft = car.FrontLeft
local seat = car.VehicleSeat
local steerAngle = 30
local maxSpeed = seat.MaxSpeed / (frontLeft.Wheel.Size.Y/2)
seat.Touched:Connect(function(hit)
if ServerStorage.ServerStatus.Value ~= "Round" or ServerStorage.ServerStatus.Value ~= "Countdown" then return end
local player = Players:GetPlayerFromCharacter(hit.Parent)
if player then
if player.UserId == car.ID then
seat:Sit(player.Character.Humanoid)
else
seat:Sit(nil)
end
end
end)
seat:GetPropertyChangedSignal("SteerFloat"):Connect(function()
frontLeft.PartB.SteeringConstraint.TargetAngle = steerAngle * seat.SteerFloat
frontRight.PartB.SteeringConstraint.TargetAngle = steerAngle * seat.SteerFloat
end)
seat:GetPropertyChangedSignal("ThrottleFloat"):Connect(function()
frontLeft.Wheel.MotorConstraint.AngularVelocity = maxSpeed * seat.ThrottleFloat
frontRight.Wheel.MotorConstraint.AngularVelocity = maxSpeed * -seat.ThrottleFloat
backLeft.Wheel.MotorConstraint.AngularVelocity = maxSpeed * seat.ThrottleFloat
backRight.Wheel.MotorConstraint.AngularVelocity = maxSpeed * -seat.ThrottleFloat
end)
What my car looks like when its broken:
I also made a post about this but I’ve been working on this for 2 days: Car hitbox completely ruining car functionality