Bug/Problem when disabling and then enabling seats

I made a dropper theme park ride that raises you up and drops you, when it’s done it disables the seats and makes the character stop sitting, it them moves the character to the exit part, then it re enables seats 2 seconds later, this is to stop the player sitting in the seat next to them and being forced to ride again.

But once disabling them and then re enabling them the character does not sit in the seats, when I reset the torso teleports back to the seat, once respawning I can then use the seats again.

So it seems I’m breaking the Humanoid some how, this script is all run locally.

--// Disable seats
for i,Seating_Total in pairs(Sky_Rise.Ride:GetChildren()) do
	for i,Seat in pairs(Seating_Total:GetChildren()) do
		if Seat.ClassName == "Seat" then
			Seat.Disabled = true
		end
	end
end
	
--// Move Character and fix Humanoid
local HumRP = Humanoid.Parent.HumanoidRootPart
local Exit_Pos = Sky_Rise.Exit.Position
	
Humanoid.WalkSpeed = game.StarterPlayer.CharacterWalkSpeed
Humanoid.JumpHeight = game.StarterPlayer.CharacterJumpHeight
	
Humanoid.Sit = false
HumRP.CFrame = CFrame.new(Exit_Pos.X, Exit_Pos.Y + 2, Exit_Pos.Z) * CFrame.Angles(0,math.rad(Sky_Rise.Exit.Orientation.Y), 0)
wait(Enabled_Delay)
--// Enable seats
for i,Seating_Total in pairs(Sky_Rise.Ride:GetChildren()) do
	for i,Seat in pairs(Seating_Total:GetChildren()) do
		if Seat.ClassName == "Seat" then
			Seat.Disabled = false
		end
	end
end

Debounce = false

After testing it is for sure the Humanoid that is not working, the player is unable to sit in any seat after this is run, how do I fix this?

Using seat:Sit(humanoid) and seat:FindFirstChild("SeatWeld"):Destroy() would be more efficient to sit and unsit the player. Enabling and disabling it isn’t very efficient, and like it has for you, may cause issues.

The only time I would recommend disabling a seat is when you don’t want a player to use it. Not to remove them from the seat.


Try this code:

local starterPlayer = game:GetService("StarterPlayer")

for i, Seat in pairs(Sky_Rise.Ride:GetDescendants()) do
	if seat:IsA("Seat") then
		local seatWeld = Seat:FindFirstChild("SeatWeld")
	
		if seatWeld then
			seatWeld:Destroy()
		end
	end
end
	
--// Move Character and fix Humanoid
local HumRP = Humanoid.Parent.HumanoidRootPart
local Exit_Pos = Sky_Rise.Exit
	
Humanoid.WalkSpeed = starterPlayer.CharacterWalkSpeed
Humanoid.JumpHeight = starterPlayer.CharacterJumpHeight

HumRP.CFrame = Exit_Pos.CFrame + Vector3.new(0, 2, 0)

This also eliminates the need for the other code since it does not disable the seats, therfore you do not need to re-enable them.

1 Like

Disabling seems to be massively broken, doing this fixed it.

HumRP.Anchored = true
Humanoid.Sit = false
HumRP.CFrame = CFrame.new(Exit_Pos.X, Exit_Pos.Y + 2, Exit_Pos.Z) * CFrame.Angles(0,math.rad(Sky_Rise.Exit.Orientation.Y), 0)
wait()
HumRP.Anchored = false
2 Likes

The reason I can’t do that was the player kept sitting in the other seat, anchoring the player then moving it fixes it, though I have to have a wait because otherwise it still moves the entire ride when moving the player.

I tested your code and the seats still break, Seats seem to be EXTREMELY tempermental.

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