Seat Part moves with player if no wait()

The player is sitting in a seat. I change their sit property to false then change their humanoidRootPart CFrame to a new location. The seat they were sitting on moves with them.

I added a wait() after changing their sit property to false and that fixed the problem, maybe.

Code sample:

local testPart = workspace.TestPart.Position
humanoid.Sit = false
wait() -- this fixes the problem
humanpoidRootPart.CFrame = CFrame.new(testPart)

I just feel like there is something I am not understanding. What I did works, but is there a better way?

When a player touches a seat part, the seat is welded to the player, which is why it will teleport with you when your humanoid’s sit property is true.

As far as I know, this behavior is intended.

1 Like

Thanks.

Do you know if there’s a better way than using a wait() after the sit = false?

Is this done in a server script or localscript?

I suspect it has to do with replication lag if its in a server script.

Otherwise try destroying the seat weld as an alternate option.

1 Like

Yes I currently have it in a server script.

When I get home I’ll be trying to move it to a client script.

Have been experiencing a similar issue when I was developing a custom character model. I remember that you need to wait for the SeatWeld to be destroyed.

humanoid.SeatPart.SeatWeld.Destroying:Wait()

I believe that should work.

It does not matter if this is a server or local script.

1 Like