Car is bugging out on player exit | Need a solution

I have a problem where the car bugs out everytime the player exits the seat,
I’ve tried pretty much everything, I’ve debugged all the changes that occur when the player exits the seat,
(The constraints, The Collision Groups, The SeatWeld) I cannot think of anything else that can be making this happen. Here’s what happens when the player exits the vehichle:

local SW = Seat:FindFirstChild('SeatWeld')
if SW then SW:Destroy() end

local HumanoidRoot = char.HumanoidRootPart
HumanoidRoot.CFrame = CFrame.new(HumanoidRoot.Position - HumanoidRoot.CFrame.RightVector * 15)

for i, v in pairs(char:GetChildren()) do
		if v:IsA('BasePart') then
				PhysicsService:SetPartCollisionGroup(v, 'Default')
		end
end

ReplicateInvisibility:FireAllClients(char, true)
ClientEvent:FireClient(player, false)
				
if IsDriving then
		IgnitionEvent:FireClient(player, false)					
					
		for i, v in pairs(Car.Wheels:GetChildren()) do
			v.CanCollide = true
			v.Tire.CanCollide = true

			v.CylindricalConstraint.AngularActuatorType = Enum.ActuatorType.None
		end
end

https://gyazo.com/a07dd22a18439a3f2d32848fff01752c

I haven’t been able to figure this out for a week or so now, any work-arounds / ideas would be greatly appreciated

A very simple solution, but probably one of the most effective:
Try temporarily anchoring the main body of the vehicle for few seconds.

1 Like

It would be effective but i want to have the car roll smoothly afterwards after the player hops out, i’m also trying to understand why exactly it is doing this too so i can avoid it in the future.

Anchoring it will make it so i have to add a ton more if-statements, It’s a good suggestion but it won’t produce the result im looking for

I found out how to fix it: You need to allow the weld between the seat and character to dissapear completely, so i added a ‘wait()’ right after the function is fired and that fixed it.

func = Seat:GetPropertyChangedSignal('Occupant'):Connect(function()
				if Seat.Occupant then return end
				
				wait()

like this ^

2 Likes