Forum rules - please read before posting.

Animation Questions

Hi, 

So, a few animation questions:

1. My player character controller seems to ignore the talk animation. I've set up a 'heroTalk_L' animation and added it to the player controller, however when the player talks the controller still plays the 'heroIdle' animation and does not switch to the talk one (see pics).
What could be the cause of this? (btw, set up talking animation for the green-shirt npc and it works fine with him...)

2. Is there a simple way to randomize the order in which the frames in a given animation are played? (useful for talking animation...)

3. I have eye blinking animations which I want to randomly trigger when the character is not talking. What would be the best approach to implement this? Should I create an action list that will run in the background or something?

Thanks!

image
image

Comments

  • So, point #1 is SOLVED (can not edit original post).

    Would still love any feedback regarding points 2 and 3.
  • For both 2 and 3, you will want to switch your character's Animation engine to Sprites Unity Complex, as this is intended for cases where more control over the character's animation is wanted.

    Sprites Unity Complex animation is covered in Section 3.9 of the Manual, and a sample variant of the 2D Demo's Player character can be found in /Assets/AdventureCreator/2D Demo/Resources/Brain2D_SpritesUnityComplex.


    2) AC can do one better than random talking frames, as you can use text-based lipsyncing.  Go to the Speech Manager and set Lip syncing to From Speech Text, and Perform Lipsync on to Portrait And Game Object.

    When your character uses Sprites Unity Complex, you will then be able to define a Phoneme integer parameter that can be used to play a different talking frame accordingly.

    3) Once using Sprites Unity Complex, you can then set up your Animator so that your Idle animation transitions to a Blinking animation every so often, provided that the "Move speed" float parameter is zero.
  • The ability to have lip syncing is truly fantastic. However, I only have rudimentary talking animation, which are not enough to do lip syncing with...
    Is there an easy way to randomize the frames within an animation?
  • Not without code, but the code itself needn't be complex.

    Once you've moved over to Sprites Unity Complex, you can re-wire your Animator so that a different "Phoneme" integer parameter causes a different talking frame to play while the character's "Talk bool" parameter is True.

    Again, see the included example character for how to play talking animations based on a boolean parameter.

    A simple script could then simply change this phoneme parameter at runtime to a new random value every few frames, e.g.:

    private void OnStart ()
    {
        StartCoroutine (RandomisePhoneme ());
    }

    private IEnumerator RandomisePhoneme ()
    {
        while (true)
        {
            int randomValue = Random.Range (0, 5);
            GetComponent <Animator>().SetInteger ("Phoneme", randomValue);
            yield return new WaitForSeconds (0.2f);
        }
    }

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.