Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by
EmK530 143
5 years ago

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.

0
Changing the cframe of a part in Roblox will break its welds. User#5423 17 — 5y
0
What are you using to move the model User#5423 17 — 5y
0
model:MoveTo() EmK530 143 — 5y
0
take a look at body movers / constrainst User#5423 17 — 5y
View all comments (3 more)
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. mantorok4866 201 — 5y
0
Why do you want this hahah iuclds 720 — 5y
0
don't use moveTo(), it will jump if it touches something. R_LabradorRetriever 198 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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)

Ad

Answer this question