How do I animate this Avatar rig?

Introduction

Hello! My name is Ithurius, I’ve been developing for a while. But I ran into an issue I don’t know how to fix.


  1. I want an avatar rig in my game to do animations. I have the animations I need, but I want the mesh avatar rig to do animations like actual players.

  2. I don’t know how to program the part to animate the mesh rig I added via the plugins tab. If I knew how to program the code to animate the rig I wouldn’t make this post. :confused:

  3. I’ve tried what I found on the internet. I looked for tutorials but they only do it to the player not the rig.


Here is the code used(so far):

local idle = script.Parent.AnimSaves.idle

local function DoIdle()
	
end

Please help me out if you know how to resolve this. Thanks for reading this thread.

So you are dealing with an NPC character? And you want it to animate? One easy way to do this is to copy the animation script from a real player’s character and edit it to use your NPC character. You will probably have to disable the chat based animation bits in that script, since there is no player attached to the NPC character. Then put the local script into the starter player scripts container. Other than that you will have to program the animations yourself. You can create animations using the animations plugin and then load, play and stop the animation based on your needs for the NPC. The NPC character will need to have the same rig type as the copied player character and the NPC will also likely require a humanoid object. I made some of my NPCs by simply copying my own player character and then changing its accessories and clothing, face decal etc…

If your NPC has a humanoid, it is as simple as taking the animation ID, making an animation object, and using Humanoid:LoadAnimation() to initialize the animation, and then playing the animation.

Make sure that your NPC is not
anchored otherwise the limbs will not animate.

More info on how to do that here:

1 Like

If you are looking to do it without a humanoid i recommend using a AnimationController instead of the solution provided above. There are no differences with it except that it doesn’t have the special humanoid functions. Just use AnimationController:LoadAnimation(). This animates the character without needing a humanoid. If you are planning to add a humanoid then do what ThousandDegreeKnife said.

The code didn’t work when I did it :
Here’s the script I used:

local Animator = script.Parent.Humanoid.Animator

local PlayIdle = Animator:LoadAnimation(script.Parent.idle)

PlayIdle:Play()

Remove the .Animator, the function is of the humanoid, not the animator.

Animator.LoadAnimation. You shouldn’t need to work directly on the Animator if you have a Humanoid object in your assembly though.