Quantcast
Channel: Questions in topic: "enemy"
Viewing all articles
Browse latest Browse all 1488

Problem with rotation of enemy

$
0
0
I'm makeing a 2d game. I have enemy on scene and I have a problem with it rotation. So It has a srcipt like: public float OffSet; public float Length; void Update() { transform.position = new Vector3(Mathf.PingPong(Time.time, Length)-OffSet, transform.position.y, transform.position.z); } And I want to put this code something what allow to rotate betwen 0-180 degree enemy when it turn and go to left side and turn and go to right side.

Viewing all articles
Browse latest Browse all 1488

Trending Articles



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