Hello,
I’m trying to make a button that plays an animation. Everything works but when I move the animation stops. I have set the priority of the animation to Action when uploading it, and made sure that the animation is looped.
Here is my code that plays the animation:
-- Variables
local humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
local radioToggleAnimation = Instance.new("Animation")
radioToggleAnimation.AnimationId = "rbxassetid://6605917300"
-- The code inside a MouseButton1Click function that plays the Animation
toggleAnimation = humanoid:LoadAnimation(radioToggleAnimation)
toggleAnimation:Play()
toggleAnimation.Looped = true
Is this on a LocalScript when the player hits the button? Also if possible I’d recommend using the Animator object inside the Humanoid?
-- Variables
local humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid"):WaitForChild("Animator")
local radioToggleAnimation = Instance.new("Animation")
radioToggleAnimation.AnimationId = "rbxassetid://6605917300"
-- The code inside a MouseButton1Click function that plays the Animation
toggleAnimation = humanoid:LoadAnimation(radioToggleAnimation)
toggleAnimation:Play()
toggleAnimation.Looped = true
When making custom animations, I think you should always set it to Action so it bypasses all existing anims. (I have no idea why roblox sets the priority to Core in the animation editor, literally no one uses Core.)