Quantcast
Channel: Answers for "Flip 2D player in x-axis to face movement direction"
Browsing latest articles
Browse All 9 View Live

Answer by swag_swag

,Simply try changing the (direction = -1) for "Moving left - " to a -1. Or perhaps direction = 1` void Start () { direction = -1; _posX = transform.position.x; Debug.Log ("Position X: " + _posX); }...

View Article


Answer by deamo

I have updated the code a bit. More correct way to determine what way he is moving on the x-axis, but he still starts to flip back and forth as soon as he moves left :( Can it have something to do with...

View Article


Answer by koray1396

in your if statement, when velocity.x < 0, you flip your character every frame by, so it flips back and forth. transform.localScale = new Vector2(-transform.localScale.x, transform.localScale.y); a...

View Article

Answer by Fubiou

Hey, I found a simple way to flip the 2d character with a simple line: transform.localEulerAngles = transform.eulerAngles + Vector3(0,180,-2*transform.eulerAngles.z);

View Article

Answer by kakubeibcn

What's wrong with `flipX = true;`?

View Article

Browsing latest articles
Browse All 9 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>