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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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