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

Why don't I stay sitting in a seat while this object is moving?

Asked by 9 years ago

I want to be able to make an object like a space shuttle orbit around a planet while people can sit in seats on the object. I used this code, but I stay frozen in the position the seat first was before the orbit began while the entire ship continues to orbit properly. Here is the bit of code that affects the movement.

local model=script.Parent
model.PrimaryPart=model.Primary
model:SetPrimaryPartCFrame(((planet.CFrame)*(CFrame.fromEulerAnglesXYZ(0, -(i*speed), 0))*(CFrame.new(0, 0, altitude))))

Does it have something to do with using CFrame? Do I have to use Vector3 instead, or what?

1 answer

Log in to vote
3
Answered by
Muoshuu 580 Moderation Voter
9 years ago

When changing CFrame, all welds connected to the moving part are automatically deleted, including the one that keeps your character connected to the seat.

Ad

Answer this question