Animation not working in game

Hello, I have searched everywhere for this fix but found nothing. I have a game right now and the animation does not play. I feel like it has something to do with my “Initial Poses” but not to sure on how to make the animation play now. If anyone has any ideas, it will be greatly appreciated I spent over 5 hours on this and can’t figure it out.

1 Like

Is that a player or a NPC? If it’s a NPC then, Convert the local animate script into a server script.

1 Like

Its a NPC but there are modes sorta like piggy so there is a player and bot mode.

The animate script needs to be a server script.

The thing is, is that it is a server script but yet it won’t work no matter what I do.

So the player mode, would be a client animate script. And a bot mode, would be a server animate script.

Already did all that but nothing. I been at this for over 5 hours now and its very frustrating that it doesn’t want to work. Is it something to do with the InitialPoses?

Does animator instance exist in humanoid? if not, add a animator instance

Is the animation priority action? If not, that might be why.

I’m using moon animator so it doesn’t give you an option.

This might be the problem. Can I see the script you’re using?

1 Like

If you are playing the animation on a rig/non-player character, I would attempt to use something similar to this script:

local rig = script.Parent
 
-- Destroy the humanoid object if it exists
local humanoid = rig:FindFirstChildOfClass("Humanoid")
if humanoid then
	humanoid:Destroy()
end
 
-- Create new "Animation" instance
local kickAnimation = Instance.new("Animation")
-- Set its "AnimationId" to the corresponding animation asset ID
kickAnimation.AnimationId = "rbxassetid://2515090838"
 
-- Create a new "AnimationController" and "Animator"
local animController = Instance.new("AnimationController")
animController.Parent = rig
local animator = Instance.new("Animator")
animator.Parent = animController
 
-- Load animation onto the animator
local kickAnimationTrack = animator:LoadAnimation(kickAnimation)
 
-- Play animation track
kickAnimationTrack:Play()

Animations cannot be loaded through both a Humanoid and AnimationController on the same rig. The script above handles this by looking for and destroying a Humanoid object which may exist. – This might solve the issue. You can’t load animations directly though a humanoid of the bot.

1 Like

Instead of using that what if I used the default animation plugin?

1 Like

You could also try importing your current animation from Moon Animator into the default animator, then setting the animation priority to Action.

1 Like

How would I import that I not new to scripting as I am sorta new to using moon.

1 Like

Open the plugin

Screen Shot 2021-12-27 at 4.04.52 PM – Self explanitory

Select the rig you’d like to animate

– Select the rig, then enter the animation name

Make sure your Moon Animation is published to ROBLOX

– Publish the animation VIA Moon Animator and open the animation in the Roblox website by going to Roblox → Create → Animations → Selecting your animation

Click import

– Click the 3 dots beside your animation name, then hover over import. Select From Roblox.

Get your animation

– Select the animation you’d like to use, or add the animation ID of that animation in the Animation ID bar on the bottom of the selector.

Done!

Be sure to click the 3 dots again, then selecting the animation priority as Action.

If it works in studio but not the game then I know the fix

If you game is owned under a group then you have to publish the animation under the group its owned by
If the game is owned by your profile then you have to publish the animation to you

2 Likes

i know that. It doesn’t work in studio

dis how i play my animations

image
image
image

1 Like