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

Look at closer to player

$
0
0
how i can look at closer to you, i want gameobject like box look at to some object like sphere, imagine is : 1 box as player, 5 sphere as enemy, i want to make player to look at enemy(just one enemy), but closer to player. And if the enemy go away, the player still look at to enemy but still look at closer to player, thanks GameObject[] Enemys; public float[] Distance; void Start () { } void Update () { //Distance[] = Vector3.Distance(this.transform.position, Enemys[].transform.position); this wrong, Enemys = GameObject.FindGameObjectsWithTag("Enemy"); //transform.LookAt(Enemys); this is wrong, but this was all I can do //please help }

Viewing all articles
Browse latest Browse all 1488

Trending Articles



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