Animation not playing

  1. What do you want to achieve? Keep it simple and clear!
    An animation that plays when you activate an item
  2. What is the issue? Include screenshots / videos if possible!
    Literally nothing happens.
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    DevForum
local Tool = script.Parent
local Handle = Tool.Handle
local NomAni = game.Workspace.NOMNOMNOM



Tool.Activated:Connect(function()
	
	NomAni:Play()

end)


2 Likes

If you are trying to play it on the character, you need to use char.Humanoid.Animator:LoadAnimation(animation) and play that

1 Like

still does not work, what path did you use for char?

1 Like

well you would need to get the character, game.Players.LocalPlayer.Character

the better way would be

local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()

This is useful because sometimes the character doesn’t load in before it is referenced.

1 Like

well, you fixed the error messages but nothing happens. I put a print ate the end and it come through. So it just isnt playing. (I do have it set to a r15 animation and forced r15 avatars btw so no problems there)

can you show your code now, and also show the animation, and also is the game under a group?

I dont have video recording but this is the link to the animation: Untitled Animation Clip - Roblox I dont know if you have access, and no it is not under a group

Code: (still very simple)

local Tool = script.Parent
local Handle = Tool.Handle
local NomAni = game.Workspace.NOMNOMNOM
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()


Tool.Activated:Connect(function()
	
	char.Humanoid.Animator:LoadAnimation(NomAni)
print("1")
end)

well, you didnt play the animation. youll want to set the loaded animation to a variable and then run :Play() on it

That worked, thanks for the help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.