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

How do i make part stay on the same spot?

Asked by
Mokiros 135
9 years ago
while true do
script.Parent.Size = Vector3.new(20,20,20)
script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(1,1,1) --rotation is important
wait(0.01)
end

When the size changes, it teleports up, because it needs more space to expand, but i can't do that. If i hold position with Cframe.new(), it stops rotating. The problem is: it teleports brick up when size changes.

1 answer

Log in to vote
1
Answered by
Unclear 1776 Moderation Voter
9 years ago

Save the CFrame in a variable first before doing the size change. This way, we remember where the part was in the first place!

while true do
local remember = script.Parent.CFrame
script.Parent.Size = Vector3.new(20,20,20)
script.Parent.CFrame = remember * CFrame.fromEulerAnglesXYZ(1,1,1)
wait(0.01)
end

Ad

Answer this question