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

How do I tween a Parts Cframe back to a previous one?

Asked by 9 years ago

How do I tween a Parts Cframe back to a previous one.

Like some sword scripts, will perform multiple actions then tween it's cframe to the original cframe/pose of the part or object.

2 answers

Log in to vote
1
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
9 years ago

Well, usually in the beginning of the script, before the function or event occurs, they'd set a variable that defines the original Position. So:

local Original = game.Workspace.Part.Position

-- Rest of code here.

game.Workspace.Part.Position = Original
Ad
Log in to vote
-1
Answered by 9 years ago

I don't think you can. If you want to animate, you gotta use Roblox's plugin or use a script and change its CFrame iteratively. It's tedious but that was how most Roblox guns were animated.

Answer this question