Why is my vehicle doing this?

it was working before idk now it’s snapping or something when I enter. It’s not even when I get out, which is when I would think the problem should occur, but instead it’s when I enter the vehicle. How do I stop it from snapping when entering to player orientation??

code to enter (inputted in all vehicle seats/seats in the vehicle):

local VehicleSeat = script.Parent.Parent
local lastoc = nil

local c = script.ProximityPrompt:Clone()
c.Parent = VehicleSeat
c.Enabled = true

VehicleSeat:GetPropertyChangedSignal("Occupant"):Connect(function()
	local oc = VehicleSeat.Occupant

	if oc then
		c.Enabled = false

		local character = oc.Parent

		lastoc = oc
	else
		if lastoc then
			local character = lastoc.Parent
			
			lastoc.Parent:PivotTo(VehicleSeat.ExitPos.CFrame)
			lastoc = nil
			c.Enabled = true

		end
	end

end)

VehicleSeat:WaitForChild("ProximityPrompt").Triggered:Connect(function(Player)
	VehicleSeat:Sit(Player.Character:FindFirstChildWhichIsA("Humanoid"))
end)

There’s excluded code like making limbs cancollide false and making limbs transparent, I don’t think that affects anything.

1 Like

I think it’s because of the Character:PivotTo() call. I’m positive that VehichleSeat:Sit() automatically positions the player?

1 Like

PivotTo is for when the character exits, which I would think would be the error yet instead it’s when I call :Sit() on the seat

1 Like

I need to fix this

ok fixed by pivoting to seat and calling sit

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.