Forum rules - please read before posting.

How to mirror player using Unity Sprites Complex?

Seriously, how do I do that?...

I've got a 2D mecanim character set to SUC and I have a working idle and walking animations, both facing right. I've added parameters Speed, IsTalking and Direction. When walking left it just plays the same walking animation without mirroring it, so basically moonwalking (there's an option I can check called "mirror" in animator but it doesn't do anything it seems; it also requires a Bool, whilst Direction is a float).

http://i.imgur.com/aVdjZ8y.png

It seems like I spent half a day looking for tutorials on YouTube but in all of them the player mirroring is done through scripting and I'm sure there must be an easier way...

Please help! ;)



Comments

  • The frame-flipping feature in the Player Inspector is only available when using Sprites Unity, not Sprites Unity Complex.

    Mirroring the animation in the Animator is indeed the way to go, but you need to use the same animation clip in two separate animation boxes - one with mirroring, one without - rather than dynamically changing the mirror checkbox each time it's run.
  • Thank you! :)

    It's tricky but I've done it now ;) - still a little glitchy but it's just a matter of some fine-tuning ;)

    As for the slowing down near walls -  I checked the box, the character now indeed stops playing walking animation upon hitting a collider but if the controller stick is still pushed it wobbles in place incontrolably like it's beaing attacked by a swarm of bees :P  I wonder if there's some way to stop it completely?...

    Also, Chris, dude, you deserve a medal or something for what you're doing here ;) Your replies never quite fully explain step by step what to do and yet somehow always manage to put me on the right track and figure things out. Thanks again! ;)
  • You're welcome.  Sometimes the answer isn't so clear so tips on the general direction is more important.  It should be said that the "slow near walls" feature was made primarily for 3D characters, and the emphasis is on "slow" rather than "stop".

    The wobbling can likely be reduced by tweaking the settings in both the character Inspector and your Mecanim window.  Have a look at the walk speed float parameter's value when the wobbling occurs, and see if you can adjust the transitions to only play the walk animation(s) when the character is walking unhindered.
  • Mirroring the animation in the Animator is indeed the way to go, but you need to use the same animation clip in two separate animation boxes - one with mirroring, one without - rather than dynamically changing the mirror checkbox each time it's run.

    Can I please ask or see an example of how to set up these animation boxes so the animation is mirrored? I am also using Unity Sprites Complex and need to do this for my Idle and Walk animations. Including how to create transitions - what with what specifically. I understand the logic following the Making a 2D Character tutorial, but I am a bit lost in this.

    I attempted to create something, but it didn't work at all: made two animation boxes for Idle L, U, D, and Idle R (with the mirror checkbox checked) and the same two boxes for Walk. Did transitions between the two types, among them and across. Didn't work.

    Then I simplified it and made just two boxes for Walk - I have 4 directions, so one had angles 0, 90, 270, and the other 90 (and mirror checked). made transitions just between them. Didn't work either. What am I doing wrong?

  • SUC frame flip script has been my faithful companion for years ;)

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.