Code I have so far:
1 | script.Parent.ClickDetector.MouseClick:Connect( function () |
2 | script.Parent.CFrame = script.Parent.Parent [ "FrontHood_I" ] .CFrame |
3 | script.Parent.Orientation = ( "0, 0, -30" ) |
4 | end ) |
Now that it's position is exactly FrontHood_I's, how do I make it go back to it's original position?
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:
1 | local myPart = Instance.new( "Part" ) -- Create a part |
2 | local myPartPos = myPart.Position -- Reference this to get the original position |
3 | -- Code below |