Players position updating to where animation finished?

I’m trying to make an animation to start off a game and i want to know how i could get the players position to be set to the position at the very end of the animation.

Kinda hard for me to explain, but hopefully you know what I’m getting at here.

–Example Video Of What Happens
Example (2).wmv (1.2 MB)

Heres was my sad attempt at trying to get something working

HumRootPart.CFrame = (CFrame.new(-4.2918548583984375, -1.5652389526367188, -2.537181854248047)):ToObjectSpace(HumRootPart.CFrame) * CFrame.Angles(0,90,0)
--The positions in the CFrame.new() are the offsets of the final frame in the animation

it wouldn’t work because while the animation is playing only the rig body part is moving not the primary part which is why trying to move the HumanoidRootPart to the HumanoidRootPart did nothing since it technically the same position before the animation start

You can set the dummy’s primary CFrame to the Dummy Torso after the animation end

local dummy = script.Parent
local Animator = dummy.Humanoid.Animator
local Animation = script.Animation

local AnimationTrack = Animator:LoadAnimation(Animation)
AnimationTrack:Play()
AnimationTrack.Stopped:Connect(function()
	dummy.PrimaryPart.CFrame = dummy.Torso.CFrame
end)

beware doing something like this will look weird as hell if you want to make an animation that change the position of the Model I recommend making all animation in a one place (Do not touch the Torso’s Position) and then use the script to move the HumanoidRootPart instead

1 Like