Direction Facers

A Direction Facer controls how your character handles a change in the characters FacingDirection property. It is used to ensure your character faces the right direction.

 

Out of the box there are several Direction Facersnoptions but you can also write your own.

 

Direction Facers

Type Description Documentation Link
UnitySpriteDirectionFacer Responds to direction changes by inverting the x scale of the GameObject it is attached to. Usually this would be a sprite renderer where inverting the x scale mirrors the character.  
UnitySpriteAimDirectionFacer Similar to the UnitySpriteDirectinoFacer but instead of using the facing direction it uses the aiming direction. With this you can have a character who faces one way while moving the other.  
ModelRotationDirectionFacer

Responds to direction changes by rotating the model around the Y axis. Generally used for 3D models.

Not for use with animations which apply root motion (Advanced).

 
LeftRightAnimatorOverrideDirectionFacer

v1.1.0 Only

Uses a different set of animations for each direction via the use of an

AnimatorOverrideController.

 

Typically used when you have a character who is not visually symmetrical (for example see Bionic Cop with his Bionic left arm).

Left/Right Direction Facer

 

 

 

 

Have more questions? Submit a request

2 Comments

  • 0
    Avatar
    Alessandro Salvati

    Hi,

    I'm developing a 2.5 game with spline colliders for the level geometry and 3D models for much everything else. 

    I found that the ModelRotationDirectionFacer only works with the basic character, while I'd also need every 2.5D feature for the enemies as well.

    How can I adapt the code for enemies? Is it feasible? I'm on a tight schedule and would like to know the fastest approach to this.

    Note that the enemies I need to code are just like those of Ghouls'n'Goblins, so I need movement on a spline, rotations, and things like that. I'm using the most populated Animation controller provided (that one with all the possible character transitions) and changing animation clips accordingly. I don't know if this is the correct approach.

  • 0
    Avatar
    Alessandro Salvati

    Solved: I simply replaced in ModelRotationDirectionFacer.cs all occurences of "Character character" with the common interface "IMob mover", now works for in both cases!

    Edited by Alessandro Salvati
Please sign in to leave a comment.
Powered by Zendesk