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

How do I make a part that has a changed position go back to it's original position?

Code I have so far:

script.Parent.ClickDetector.MouseClick:Connect(function()
    script.Parent.CFrame = script.Parent.Parent["FrontHood_I"].CFrame
	script.Parent.Orientation = ("0, 0, -30")
end)

Now that it's position is exactly FrontHood_I's, how do I make it go back to it's original position?

1 answer

✓ Accepted answer

You should store the position in a variable before you change it and then have it go to the position stored in the variable when you need to.

Sample code:

local myPart = Instance.new("Part") -- Create a part
local myPartPos = myPart.Position -- Reference this to get the original position
-- Code below

2 comments

0

Oh... shoot.. But thanks!

0

If I helped, mark this answer as accepted please!

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