Animation not playing

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want the animation to work

  2. What is the issue? Include screenshots / videos if possible!
    The animation isn’t playing

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    Tried multiple ways to do it

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

I have tested the animation and it works, it is owned by the same owner as the game, I have no idea why this isn’t working. It is a part and has a humanoid and if it helps is inside of a viewportframe.

		local animation = Instance.new("Animation")
		animation.AnimationId = "http://www.roblox.com/asset/?id=14997473539"
		local animationTrack = plr.PlayerGui.eggHatchGui.holderFrame.ViewportFrame.firstEgg:FindFirstChild("Humanoid"):LoadAnimation(animation)
		animationTrack:Play()

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

Http link instead of Https for a Roblox URL … strange; anyways:

Replace the above with this part:

animation.AnimationId = “rbxassetid://14997473539“

For future reference, don’t actually put the url, just grab the ID and add “rbxassetid://“ before it.

Still didn’t work, I know to use rbxassetid://, was trying something new because of a post on the devforum saying it fixed their issue with the animation not working. Anyways, this did not work either.

Okay then it is probably working but maybe the eggs just doesn’t have the right parts to actually conduct the animation.

Couldn’t you just use a simple tween or just use the egg’s CFrame to create the animation? You probably don’t want to but I thought I would just suggest it

What’s weird is that it works perfectly fine outside of the viewportframe, but inside of it it doesn’t work right.

Strange, are you sure that you’re using the correct camera?

Yes, the egg shows up but the animation doesn’t work.

1 Like

Hm that’s strange, so it works outside of the viewport frame but not in it.

Strange.

The problem is in the viewportframe, You investig for play animation in viewportframe

You can’t use animations in ViewportFrames, parent a WorldModel to the frame and parent the egg to that WorldModel, now you can animate on it
More info

1 Like

I think you should try making an animation instance outside the script and enter only the id number and it will automatically change it that is what happened with mine I think that might work if not here is my script for my tool:

local hum = game.Workspace[game.Players.LocalPlayer.Name]:FindFirstChild("Humanoid") --change this to the actual route to the player's humanoid
idle = hum:LoadAnimation(script.Idle)
idle:Play()

This is my script for handling animations when a player equips a tool be sure to change the route of the hum variable to the actual humanoid and add animation instances to the script.

Hi, I did this but the animation will still not play? (it plays shown by :GetPlayingAnimationTracks() but doesn’t appear to play)