Forum rules - please read before posting.

Please help me understand Expressions

Hello there,
First time posting to a forum ever, so please forgive me if I've got something wrong.
I've been teaching myself Adventure creator for a couple of months and making progress but I've run into a couple of issues I'm unable to find answers for. I'm missing something in the tutorials/manual (the link the manual provides leads to a dead web page) and other forum posts (which the most recent I can find is from a couple of years ago), I just can't wrap my head around. I've currently got two problems, I could really use advice on, and I'm very much new to unity with little to no programming knowledge (nothing like jumping into the deep end right.)

Currently I'm working on a 2D point and click adventure. I've got the characters set up to talk via a conversation.
However, the artist I'm working with wants them to have an idle animation, then turn slightly to face the player, then begin a conversation. After every line the characters reset into their default idle animation. I'm using unity complex for the animation type as per the tutorial advice. Though we don't have bones or anything within the sprites just multiple frames of animation. So I might be using the wrong type there.

I tried using Character: Animate, and set standard, and overwrite the idle animation. but that just causes the character to never stop speaking (talking with mouth movements) if I set standard and select talk, then they never open their mouths.
And when I select the NPC with Character Animate I can't see the option to set standard.

My other problem is the expressions. I've tried to figure this out and I've created 3 expressions with animations, ticked the box marked use expressions and labeled them up. I put [expression:annoyed] in the dialogue box but nothing. I've read a couple of posts saying I need to link them to the Any State with the animator controller, but I don't know how to trigger them and linking them up to the Any State just completely broke my walk cycle animations.

I'm sorry for the ramble, but I'm stumped here. If any ones got a video tutorial about this specific topic I'd much apprecicate it or any advance really. Once again my complete lack of knowledge is more than likely holding me back from understanding something very simple.

Many thanks for taking the time to read.
Kal

Comments

  • Welcom to the community, @Kal.

    the link the manual provides leads to a dead web page

    Which one? I'll see this gets corrected.

    the artist I'm working with wants them to have an idle animation, then turn slightly to face the player, then begin a conversation.

    Is this a case of the character turning, and then playing the idle animation of a different direction?

    If so, the Character: Face object Action can be used to turn the character. So long as your have your Animator making use of a Direction parameter to vary the animations based on their facing directions, the character should then turn.

    The included "Brain2D_SpritesUnityComplex" Player prefab should provide an example of this.

    Alternatively - if you want a specific animation to play at this time - with Sprites Unity Complex, you can introduce a Bool parameter that reroutes your animation states.

    For this, create a new Bool parameter in your Animator Controller, and reference it in a Transition from their Idle state to the intended state. To invoke this transition, you can then use the Character: Animate Action's Change Parameter Value method to set this parameter to True when the conversation sequence begins.

    And when I select the NPC with Character Animate I can't see the option to set standard.

    A quick note on this: what options the Character: Animate Action provides depends on the "Animation engine" used by the affected character. "Set Standard" is an option for Sprites Unity characters, as it works by playing animations directly by naming convention. With Sprites Unity Complex, animations are played using regular Animator transitions and parameters. AC can control certain parameters automatically, but you can override behaviour through the use of separate transitions (as above).

    I put [expression:annoyed] in the dialogue box but nothing.

    When using Sprites Unity Complex, you can opt to define an Expression ID integer in the "Mecanim parameters" section at the top of the character's Inspector. Have you assigned this to an Integer parameter that's also defined in the Animator Controller?

    If so, this parameter value will then be set automatically as the expression tokens are detected. It's case-sensitive, mind.

    Before anything else, check that this parameter token is updating correctly at runtime. When the [expression:annoyed] token is parsed, for example, check that the Integer parameter is set to the ID value of the "annoyed" expression.

    Once this is so, it's then a case of introducing this parameter into your Animators transitions to cause different talking animations to play accordingly.

    I wouldn't advise using the Any state, but I would recommend checking Has Exit Time in the transition options - so that the effects are felt immediately if the Animator is playing the correct starting state.

    As this is a visual issue, it'll be best to see what you're working with. If you're having trouble, post some screenshots over on e.g. imgur.com, share links here and I'll try to see what's what.

  • Hi there, thank you so much for getting back to me, I feel quiet foolish, seems that somehow I had my main character as sprites unity and my NPC as sprites unity complex.

    And I only noticed this because of your tip about the Character animate action. I had incorrectly assumed it was because the main character was a PC and the option simply wasn't there for NPCs.

    Can't believe I hadn't noticed. I will go over all of this help once I have reconstructed my main character. I believe one problem I will not know how to solve is that the artist has a different Idle, Walk and talk animation depending on if the character is facing left or right.

    I'll post some screenshots soon as I know I'm still going to need help and advice.

    In regards to the broken link it's on the bottom of page 351
    in the Pro tip section about a tutorial working with expressions.

    Once again, many thanks for all the advice and very prompt response and warm welcome.

    Kind Regards
    Kal

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.