Hello. I would like to have an animation play, and keep the character in the final state of the animation until a script tells it to stop playing. How would I achieve it? I haven't seen any guides, and the roblox docs script errors out, so I am stuck.
COMMUNITY QUESTION
Help with animations and keeping animations playing?
1 answer
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAddedWait()
local Humanoid = Character:WaitForChild("Humanoid")
local New_Animation = Instance.new("Animation")
New_Animation.AnimationId = "rbxassetid://00000000" --replace 00000000 with your animationId
local Animation = Humanoid:LoadAnimation(New_Animation)
Animation:Play()
repeat wait() until Animation.TimePosition >= 0.5 -- or whatever time you want it to stop at
Animation:AdjustSpeed(0) -- stops the animation
Animation:AdjustSpeed(1) -- resumes the animation
This discussion is preserved as it was. New answers, comments, and votes are closed.
