Hi! My first question here,
I'm still figuring out in a testgame how things exactly work now. But one thing is really breaking my head. I'm working in 2D. I have made an NPC that doesnt move. (Cause i dont want it to move) But the player can have a small conversation with it now, that works, and it can use an inventory item on the npc, that also works except for one thing. In the action list of what happens when you use the item on the npc I also want to play an animation, only once. And then the npc changes in something else. That all happens, but I can't get the animation working. How do i do that?
In the meantime I had it working, the animation. But it was just playing all the time on the NPC and not only once at the moment that I wanted it to play.
Comments
I'll need some more detail about your setup before I can help too much - screenshots of your Animation Controller and NPC inspector would be a big help.
You need to use the "Character: Animate" Action to animate an NPC beyond the standard idle/walk/talk animations. What have you got currently?
The Character: Animate Action is used extensively in the 3D Demo, which is included with AC. I'd suggest picking it apart to see how it's made, when it comes to things like this.
While AC's Legacy (i.e. Animation component) is there to make things easy for those getting started (just call an animation, and it'll run), AC's Mecanim (Animator component) support is intended to give more control to the user over their animations - but it does require that the user is knowledgeable about the way Unity's animation system works.
Have a look through Unity's documentation about Mecanim before trying to implement it in AC. Otherwise, just make use of Legacy animation and let AC handle it for you.