Playing Animation on Mouse Click

you could do that by changing the AnimationTrack’s Priority you can check this here :
https://developer.roblox.com/en-us/api-reference/property/AnimationTrack/Priority

Ok, let me check it out. (making more character for the forum)

How do I change the animation’s track priority tho?

Change the animation priority in the anination editor or the Keyframe sequence which is where all your keyframes are stored. I would also suggest looping your animation if you want it to play endlessly.

Uhh what do you mean??? I just made the animation property to Action in the editor BUT when I walk around my hands keep moving when the animation is playing on my hands. So… that’s a issue PLUS how would I loop? and if I look would will it just play the animation then go back to the ROBLOX animation then play it again??? I don’t want it going to the ROBLOX animation.

Did you animate the hand or does the hand not have a keyframe? Try animating or moving the hand a little bit in the editor

20220808_080326

There should be a button with an arrow circling around a “Play Button”. Press it and it should loop

Try this then. This should work, hopefully. If it doesn’t, let me know!

local Players = game:GetService("Players")

local localPlayer = Players.LocalPlayer
local character = localPlayer.Character or localPlayer.CharacterAdded:Wait()

local HandsUpAnimation = workspace:WaitForChild("HandsUp")

local Humanoid = character:WaitForChild(“Humanoid”)

local PlayAnimationButton = script.Parent

local LoadAnimation = Humanoid:LoadAnimation(HandsUpAnimation)

PlayAnimationButton.Activated:Connect(function()
	LoadAnimation:Play()
end)

(Note: The “PlayAnimationButton” variable is set to script.Parent as I do not know the ancestry of the script. If the button isn’t the parent of the script, change the variable accordingly.

Example, if the parent of the script was the ScreenGui: script.Parent:WaitForChild(“PlayAnimationButton”)


And also yes. Whether you change a player’s WalkSpeed via LocalScript or a ServerScript, all players will see the change.

you can create another animation that basically loops and implant it into the script after when the first animation stops playing.

It worked thx. (adding extra character)

Got it to work thx! Adding characters

As far as I know, animations on the client are automatically replicated to the server, so that would not do anything.

Wait so basically since I looped the animation in the editor I had to delete the first tick mark thing. So basically when playing the animation it will just show the hands go up without really any animation. BUT I want the animation to take like 5 seconds before the player’s hand touches the sky. I could easily to do it by adding that 1st tick mark thing I deleted but then that will loop too which will make it go to default ROBLOX position in the loop.