How to make player stay seated on a tweened model?

I have a model that is being tweened with seats in it. However I made it so that the model shakes around with tweens, this causes the player to be kicked out of the seat. How do I make it so that the player doesnt keep falling off the seat? video:

2 Likes

I assume something is causing the seat’s “SeatWeld” weld (which welds the player’s character to the seat) to break, you could fix this by re-welding the player’s character to the seat each time this weld snaps.

image

Welds shouldn’t be affected by velocity though? Unless you mean the tweening.

probably you tweened the seat and the weld broke, do as forummer says and if that doesn’t work, you could use a weldconstraint (never breaks)

local run = game:GetService("RunService")
local seat = script.Parent

local weldConnection

seat:GetPropertyChangedSignal("Occupant"):Connect(function()
	if seat.Occupant then
		local c0 = seat.SeatWeld.C0
		local c1 = seat.SeatWeld.C1
		local humanoid = seat.Occupant
		local character = humanoid.Parent
		local hrp = character.HumanoidRootPart
		weldConnection = seat.ChildRemoved:Connect(function(child)
			if child.Name == "SeatWeld" then
				run.Stepped:Wait()
				local weld = Instance.new("Weld")
				weld.Name = "SeatWeld"
				weld.Part0 = seat
				weld.Part1 = hrp
				weld.C0 = c0
				weld.C1 = c1
				weld.Parent = seat
				weldConnection:Disconnect()
			end
		end)
	end
end)

I just wrote this script which recreates the weld between the player’s character and the seat (in case it snaps), you’ll likely need to wrap this in a toggle otherwise the player’s character will be welded to the seat forever.

this still makes the player get kicked off the seat. It just makes it so I cant jump off.

ive tried weldconstraints and it didnt work for some reason.

Have you welded the Seat instance to other parts of the Seat? Cuz it looks like you’re still sitting after falling. That means its the seat that falls and not that the player jumped off the seat.

the seat is indeed welded, heres a video of it while I have it selected:

Can we take a look at the seat parts and the weld in your explorer?

only one seat is welded but that was just for testing

Alright, remove the extra seats, you might be seating on the extra seats that was not welded.

I’m not. I removed all the extra seats and it still did it.

Alright, just remove it either way cause you might be sitting on the extra seats that is not welded in future. Now, check if the seat part is following you when you fell. We need to know if only the player fell or the seat somehow became unwelded too.

Only the player fell, you can see the video I attached where I selected the part. Also the weldconstraint is being disabled every time the plane tweens, that may be it.

Since the player did not fall in that video, It’s hard to see if its moving along with the player or not, but if that is truly the case, then check if the seat.Occupant property still have the player’s humanoid.

the seat has the players humanoid the entire time, the player just flops from the seat for some reason.

Alright, so all I can think off is Roblox physics. Ye.

Basically, Roblox physics just breaks the weld between the Character and the seat when the model is tweened, but keeps acting as if the Character is still sitting. Here I can propose to you some solution.

  1. Use BodyVelocity to move the aeroplane
  2. Use WeldConstraint to weld the character and the seat. As @hatespine stated, it NEVER breaks. So it will make your character stay welded to the seat at all times. (You said it didn’t work, but that would just be another problem of how you use WeldConstraint, so just use it and show us the code of how you used WeldConstraint if you still have a problem with it)

I got forummers script, put it into a script and into the seat.

Alright, now use WeldConstraint. I don’t know what that script is but it used weld so it’s not related.

As I said too, and again, WeldConstraint NEVER breaks, so that script is not needed. You should just use WeldConstraint to weld the character and the seat the first time the character is seated and unweld the character once unseated.

Refer to WeldConstraint on how to use WeldConstraint.

You just have to set the WeldConstraint Part0 property to the Seat. Then set the Part1 property to the Character’s HumanoidRootPart or its torso once the character is seated.