My way of animating an NPC in FE is this way:
First have a normal Script in the character
In that Script insert an animation with the animation ID you want
In the Script
First we're going to make sure we have something to play the animation from.
1 | local char = script.Parent |
2 | local humanoid = char:WaitForChild( 'Humanoid' ) |
This part sets the local char as the script's parent but you can change it if you have other ways of getting to the NPC. It then waits for a humanoid in the character.
Next, if we find the humanoid, we load the animation
1 | local char = script.Parent |
2 | local humanoid = char:WaitForChild( 'Humanoid' ) |
3 | local anim = humanoid:LoadAnimation(script.Animation) |
Straight forward. The animation's parent should be this script but then again you may change it for other ways of accessing it.
Finally we make the animation play.
1 | local char = script.Parent |
2 | local humanoid = char:WaitForChild( 'Humanoid' ) |
3 | local anim = humanoid:LoadAnimation(script.Animation) |
So the script checks if the character exists. If so, it will then play the animation we loaded earlier and then end.