Quantcast
Channel: Questions in topic: "follow"
Viewing all articles
Browse latest Browse all 536

My AI code is only making a sprite look Left or Right? Help please.

$
0
0
Basically in my update function for my hero i have an update which is calling this method on an enemy. However the enemy only ever looks left, or right. Can anyone help with this? function SeekPlayer(shipLoc : Vector3) { transform.LookAt(shipLoc); var rot = Quaternion.LookRotation(transform.position - shipLoc, Vector3.forward); transform.rotation = rot; transform.eulerAngles = new Vector3(0, 0,transform.eulerAngles.z); rigidbody2D.AddForce(transform.up * 3); }

Viewing all articles
Browse latest Browse all 536

Trending Articles



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