- Home /
 
 
               Question by 
               Arin_Ithilien · Jun 13, 2019 at 10:57 AM · 
                movement scriptanimator controller2d animationdirectional animating  
              
 
              How to keep 2D character facing the direction it was in(right/left), when it is moving up/down?
Hello.
My character has 2-directional animation (right/left), but it can move in 4 directions (right/left/up/down). I'd like to learn how to keep it facing the direction it was in, when it is moving up or down. This is a script I am using: 
 As for an Animator, I tried a few options to see if I can get the idea working without modifying the script but with no success. Currently, I set both 'Idle' and 'Walk' animations to simple 1D Blend Trees with Transition conditioned by 'Speed' parameter: 
 I suppose, I could take all the Blend Trees apart and make transitions that would link to the correct animation but that would get very messy, when adding also 'Hit' and 'Attack' animations.
 
                 
                script.jpg 
                (114.9 kB) 
               
 
                
                 
                blendtree.jpg 
                (32.1 kB) 
               
 
              
               Comment
              
 
               
              Your answer