A seat changes its CFrame/Orientation when a player sits in it

I’m trying to make a boat/ship type pvp experience, but I’ve encountered an
issue about seat parts, that I can’t seem to find a fix for. When the player sits in a chair, the orientation/cframe also changes to match the player’s root cframe. (As well as the entire boat/ship)

I’ve tried setting the seat’s network ownership to the server, tried making my own seat system, and messed with the physicsservice of the seat. But unfortunately, it either just sinks the boat or not work at all.

Here is a code snippet of my serverscript responsible for unanchoring objects:

local NewPhysicalProperties = PhysicalProperties.new(0.5)
local NewPhysicalProperties_2 = PhysicalProperties.new(0)

for _, v in ipairs(BlocksFiles:GetDescendants()) do
	if v:IsA("BasePart") then
		v.Anchored = false
		if v.Parent:IsA("Model") then
			v.CustomPhysicalProperties = NewPhysicalProperties
		else
			v.Massless = true
			v.CustomPhysicalProperties = NewPhysicalProperties_2
		end
	end
end

for _, v in ipairs(BlocksFiles:GetDescendants()) do
	if v:IsA("BasePart") then
		v:SetNetworkOwner(nil)
	end
end

Here is a clone of the seat to replicate the bug:
seatrepl.rbxm (35.6 KB)

Here is a clip of the bug in action:

Is there any way to prevent this type of bug? Thank youu in advance :pray:

I believe this is a result of your boat having a very small mass due to making the parts massless. Try making them not massless and see if that fixes it

1 Like

I’ve tried that, but it just ends up sinking the boat/ship :pensive:

Could you try changing the mass of all the parts to a mass of a naturally buoyant material?

1 Like

I’m pretty sure, I’ve tried that already. But I have a short term memory (or just getting deja vu) so I’ll try doing that

1 Like

Did I do it correctly? Did I set the wrong property…?

local NewPhysicalProperties = PhysicalProperties.new(0.5)
			local NewPhysicalProperties_2 = PhysicalProperties.new(0)
			
			for _, v in ipairs(BlocksFiles:GetDescendants()) do
				if v:IsA("BasePart") then
					v.Anchored = false
					if v.Parent:IsA("Model") then
						v.CustomPhysicalProperties = NewPhysicalProperties
					else
						--v.Massless = true
						v.CustomPhysicalProperties = NewPhysicalProperties
					end
				end
			end
			
			for _, v in ipairs(BlocksFiles:GetDescendants()) do
				if v:IsA("BasePart") then
					v:SetNetworkOwner(nil)
				end
			end

Hmmm that’s odd. Everything looks right so idk why it would fling like that. Another idea you could try is changing the players rotation cframe to match the orientation of the seat when they touch it

1 Like

It didn’t got flung, I recorded it late but it just sank. I’ll try that and see if it works

1 Like

If that doesn’t work, you could try what you did before but use a density of 0.35 (density of wood)

1 Like

Your idea worked accordingly! Thank you so much.

local Seat = script.Parent
local scf = script:WaitForChild("SCF", math.huge)

local PrevCF = scf.CFrame

game:GetService("RunService").Heartbeat:Connect(function()
	PrevCF = scf.CFrame
	for _, v in ipairs(script.Parent.Parent.Parent:GetDescendants()) do
		if v:IsA("BasePart") then
			v:SetNetworkOwner(nil)
		end
	end
end)


Seat:GetPropertyChangedSignal("Occupant"):Connect(function()
	if Seat.Occupant and Seat.Occupant.Parent:FindFirstChild("HumanoidRootPart") then
		local Root = Seat.Occupant.Parent:FindFirstChild("HumanoidRootPart") 

		Root.CFrame = PrevCF
	end
end)

Im sure, there’s a more efficient way than what I made. But it works perfectly.
(I made a simulation so I don’t have to deal with the round system I made everytime)

1 Like