Player Animation not playing

Hi there, I’m attempting to play the default wave animation on a player. This snippet is from a local script parented to a GUI in the PlayerGui folder. This was pulled from Roblox docs, though it doesn’t function or give any errors.

 local player = game.Players.LocalPlayer

    local character = player.Character
    local humanoid = character:FindFirstChild("Humanoid")

    local animation ="Animation")
    animation.AnimationId = ""

    local animationTrack = humanoid:LoadAnimation(animation)

The basic functionality of this is to make the player wave, then return to the regular idle animation.

Do you want the animation to play when you click the GUI?

Otherwise look under Changing Default Animations in this:


Make sure the character is a thing when you define “character”. :smiley:

local character = player.Character or player.CharacterAdded:Wait()