Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do you move a seat while a player is in it without removing the player from the seat?

Right now I'm making a game where at one point you get seated on a boat and after some time the boat moves away, but the problem is as soon as I move a seat the player stops sitting in it.

If there is a way to move the model with the seats in it properly then let me know, otherwise I could change the seats so you don't need to move the model, only the seats. But ofc I need to move the seats while the player remains in the seat.

7 comments

0

Changing the cframe of a part in Roblox will break its welds.

0

What are you using to move the model

0

model:MoveTo()

0

take a look at body movers / constrainst

0

if moving players with a model and still have the player sitting in its seat is what you want then its acually pretty easy, whenever I move the players character via CFrame, any seats that the player is sitting in also gets moved. this also works with the model the seat is in too.

0

Why do you want this hahah

0

don't use moveTo(), it will jump if it touches something.

1 answer

Try using tweens: Using SetPrimaryPartCFrame() moves parts and seats along with players, if its a model.

local ts = game:GetService("TweenService")
local destination = CFrame.new() -- put the destination position here, inside

local info = TweenInfo.new(
 1 -- time,
 Enum.EasingStyle.Quad, -- direction
 Enum.EasingDirection.Out, -- style
 0, -- repeatcount
 false, -- reverses
 0 -- delay
)

local cframevalue = Instance.new("CFrameValue", script.Parent)

local tween = ts:Create(cframevalue, info, {Value = destination}

tween:Play()
cframevalue.Changed:Connect(function()
	script.Parent:SetPrimaryPartCFrame(cframeValue.Value)
end)
tween.Completed:Wait()
print("Tween done!")

Thats kinda how u do it! (Kind of)

This discussion is preserved as it was. New answers, comments, and votes are closed.