Forum rules - please read before posting.

Trigger an NPC animation before and after dialogue

Hey! So i've made some progress and finally got around to playing with NPCs and conversations. It was smooth-sailing when doing the basic stuff but I seem to be stuck.

So in this 2D scene I have an NPC playing a handheld game. The plan is for when you go to talk to him (before you ask him any questions, but after the dialogue menu pops up) an animation triggers and he would put the game away and essentially pause (or go into a 1 frame "animation" for a new temporary idle). Then when you're done talking to him, he takes the game out and goes back to his original idle. It was meant to be a nice transition to go from his idle to a talk, with a temporary idle in between i guess while waiting for speech.

I thought I could do this in the action list editor, but I can't seem to figure it out. I fiddled with it once but ended up breaking the character (his talk animation wouldn't turn off), so I remade him from scratch to fix it. This was a test for me so that I could do more things like this and try and learn more for when I have to do this later.

I admit I'm still a little wet behind the ears in terms of Unity and junk, but I think I have a decently basic grasp.

Thanks in advance for the assistance!

Comments

  • I use the Character:Animate action to do stuff like this. First I create all the animations for the character, and then use the Character:Animate -> Custom animation (don't remember exact wording) and type in the name of the animation I want. You can make it return to idle after one playthrough, or you can turn off the loop of the animation if you select the animation file and turn off loop in the inspector.
  • Yes, Character: Animate is the way to go.  The exact method will depend on your character's Animation engine setting (see the Manual's sections 3.6 and 3.9 for the two options for 2D).

    You can either change the character's idle/talk animations, or override both with a custom animation - both can be done from this Action, however it also depends on your Animator being set up with the animations you want to play.  If you still have trouble, please post screenshots showing what you have so far so that we can give more specific advice.
  • Thanks you guys! Idk what I was doing wrong when I originally tried it but it works now. Only thing is that about 50% of the time when he finishes talking he'll revert back to idle for a split-second when going to the different idle talk. Not the biggest issue I was just curious
  • That likely depends on how you're doing it, and the particulars of your Animator Controller.  Can't say much more without seeing some screenshots.
  • in the characters animation controller, click on the animation, and in the editor click the name of the animation. You can see its settings, and turn on the looping to stop it going back to the first frame of idle.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.