Animation does not play

When I press a key an animation should play, but it is not playing. I know it’s working because I have the “KeyframeReached” event, and the stuff inside the function is running after some time.

So basically, the animation is running, but I can’t see it? or it isn’t loading? I don’t know

The script:

	local char = plr.Character or plr.CharacterAdded:Wait()
	local hum = char:WaitForChild("Humanoid")
	local hrp = char:WaitForChild("HumanoidRootPart")
	
	local deathBeamAnim = hum:LoadAnimation(animations.DeathBeamAnim)
	deathBeamAnim.Priority = Enum.AnimationPriority.Action
	deathBeamAnim:Play()

Please show the code and errors if any.

Is the animation priority set to action?

local deathBeamAnim = hum:LoadAnimation(animations["Death Beam Animation"])
	deathBeamAnim:Play()
	
	print(deathBeamAnim.isPlaying) -- Prints true

no errors

not sure, Imma do it manually inside the script to see if it fixes it

it is set to action and still doesn’t work

Are there any errors? 30 chars

Make sure the humanoid is the right humanoid and also check if the animation itself is even working (Open it in animation editor or whatever), sometimes animations are blank.

Have Tried To Rename Your Anim? I Mean Without any spaces, sometimes roblox has problems with it!

Have you tried using this script? Also don’t leave in the “variable” part.

local variable1 = script:WaitForChild(“Animation”)
local variable2 = script.Parent:WaitForChild(“Humanoid”)
local variable3 = thisdude:LoadAnimation(variable1)
variable3:Play()

Also make sure to put an animation into the script and put your animation ID in the animation.

Solution?``

just tried doing that, didn’t change anything

As I said, there’s nothing wrong with the script, the problem is something else (I know that because I got no errors, and used print to debug)

im doing it on the server, using a remote event fired by the client to the server

Sorry if i typed something wrong because im not on pc :joy: test it this might work without remote event

  local player = game.players.LocalPlayer or game.Players.PlayerAdded:Wait()
    local character = player.Character or player.CharacterAdded:wait()
    local humanoid = character:WaitForChild("humanoid")
    local anim = Instance.new("Animation")
     local anim.AnimationId = "rbxassetid:// " --your animation id here
     local track = humanoid:LoadAnimation(anim)
    local uis = game:GetService("UserInputService")

    function onKeyPressed(InputObject)
          if InputObject.KeyCode == Enum.KeyCode.Q then
    track:play
    end
    end
    uis.InputBegun:Connect(onKeyPressed)

I need the remote event

30 chars

1 Like

I already said the script is not the problem, I can script, and it works ;-;

1 Like