- Home /
Question by
Azman138 · Sep 15, 2017 at 01:46 PM ·
scripting beginnerrangeufpsenemy-ai
How to decrease the tactical shooter ai enemy watching range?
in tactical shooter ai the range of the enemy team is too much ..they are attacking my hero from a range of more than 1000 meters.but i cant find the solution how can i decrease the enemy's watching range? please help me out i cant use it in ufps for this problem.
Comment
Best Answer
Answer by MT369MT · Sep 15, 2017 at 04:36 PM
Hi
Enemy Script Public GameObject Player; Public float Range; void Update() { Range = Vector3.distance(transform.position, Player.transform.position);
if (Range < 50) { //here make your enemy attack the player } }