Hi!
I've had a go at putting the 2d Unity Sprites Complex prefab together using the new head turn feature but I'm still having a headache trying to get it work. I've followed and copied the Brain prefab example & manual too as best I can but I'm seriously stumped. Using Unity version 2017.3.1f1. Was using AC 1.62.1 but have now upgraded to the latest version.
Here's what I've done so far:
Created new character (using the Wizard), ensured Sprites Unity Complex enabled and created the Mechanim parameters as per Brain.
Body - Dragged Idle sprite into the Hierarchy. Named it 'DawesBody' (child of above).
Created Empty Game Object and named it 'DawesHead' (child of above), placed it above the body.
Dragged in all 8 heads with position of 0,0,0 (children of above).
MoveSpeed, FacingAngle, IsTalking, HeadAngle, Direction parameters created as per Brain.
Animator Layer - BodyDirection: 'DawesIdle' Blend Tree created. These are just the body animations.
'DawesWalk' Blend Tree created. These again are just the body animations. The walk and idle animations work perfectly in the game for the body.
HeadDirection layer created and blend tree created. (Noticed DawesBayIdle_UL was wrong - already corrected to the correct DawesHead_UL)
Talking Layer created. DawesHeadIlde and DawesTalk states created. Both Motions allocated.
Separate body direction animations created (x8). These are named:
DawesBayWalk_D
DawesBayWalk_L
DawesBayWalk_R
DawesBayWalk_U
DawesBay_DL Walk
DawesBay_DR Walk
DawesBay_UL Walk
DawesBay_UR Walk
(does is matter if they're a bit different in name?)
Example:
Body animations work perfectly. DawesHead Position doesn't change at all. Doesn't seem to be linked. When the game is played, all heads are visible. They move around with the character but do not bob up and down or change to the correct directions & specific head walk animations.
Idle Body Animations I've created:
DawesBayIdle_D
DawesBayIdle_L
DawesBayIdle_R
DawesBayIdle_U
DawesBayIdle_UL
DawesBayIdle_UR
DawesBayIdle_DL
DawesBayIdle_DR
Example:
Again, body animations work perfectly but all heads are visible.
Example below of the Sprite Renderers. All 8 created as per directions required.
DawesHeadIdle Sprite animations
DawesHeadWalk Sprite animations created. I need these as her hair bobs around when she walks. These don't play in the game. Just shows the 8 static heads that move around with the character.
DawesTalk Sprite animations created. These don't play when my character talks, it just shows all 8 static heads.
Do let me know if you need any further screenshots or information. I'm obviously missing something or numerous important things but I just can't for the life of me work it out.
This is what I see in the game view:
Thank you in advance.
Comments
The actual head idle/talk animations look very complex - one thing to bear in mind is that animating the position of "DawesHead" in the body animations can save you the need to animate the head-bobbing in the animations themselves. Since they'll play at different times anyway, I'm not sure the head-bobbing would sync with the body otherwise.
You haven't shown the transitions between "DawesHeadIdle" and "DawesTalk", but they need to react to the "IsTalking" bool - if they are, is this bool's value being changed correctly when she talks?
The "facing" animations (e.g. DawesHead_D) only need to be a single frame - try removing the second. The BlendTrees look fine, but make sure that your Player Inspector's "Angle snapping" is set to "Forty Five Degrees" to avoid interpolation between the states.
This is a pretty complex feature to get going, admittedly. If the above advice doesn't solve things, you can PM me a .unitypackage file of her assets (prefab, animation, sprites) and I'll take a look.
It's not so much the head bobbing, it's her hair that bobs but noted about the syncing issue. The thought I had was to add the head animations to the body animations and manually adjust the positions (as per screenshot below). Granted it's a lot of work but I'm willing to do it. But, I'm still left with all heads visible in the game.
I would like to take advantage of the talking head while she's walking (when dialogue is played in the background) so reluctant to revert back to full head and body animations. Would this even work? I'm not competent with the Animator feature, it's rather confusing, so I'm just guessing.
Ok, so Angle snapping is definitely set to 45 degrees. Also when she's talking the IsTalking bool is ticked however the animations don't play in the game and I just have the static view of all 8 heads (it not a good look for her).
"The "facing" animations (e.g. DawesHead_D) only need to be a single frame - try removing the second. " I've done that, no change unfortunately. Made a new prefab too.
I'll take you up on your offer and PM you the package. Thank you so much!
Thanks Chris, total superstar!