Quantcast
Channel: Questions in topic: "left"
Viewing all articles
Browse latest Browse all 135

Face player right/left

$
0
0
I have a player that runs right and left. His body is always faced to the right. I want my player to face right when i make him run right and face left when i make him face left. I have a code that splits the screen into 2 buttons. Heres my code if (Input.touchCount > 0) { Vector3 position = Input.touches [0].position; float movement = (position.x < (Screen.width / 2)) ? -0.05f : 0.05f; transform.Translate (movement, 0, 0); So how can i porgram him to face right when i press the right side of the screen and opposite? Appreciate answers.

Viewing all articles
Browse latest Browse all 135

Trending Articles



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