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

Enemy AI makes enemies walk up walls? **SOLVED**

$
0
0
I have enemies with ai's that follow you around but the enemy can basically walk up any slope no matter how steep. How can I stop it from doing this? Also sometimes whenever they hit a wall or something they go awol and just start running in random directions. by the way i got this script online and have no idea what im doing with it (sorry for my noobishness) #pragma strict var Player : Transform; var MoveSpeed = 4; var MaxDist = 10; var MinDist = 5; function Start () { } function Update () { transform.LookAt(Player); if(Vector3.Distance(transform.position,Player.position) >= MinDist){ transform.position += transform.forward*MoveSpeed*Time.deltaTime; if(Vector3.Distance(transform.position,Player.position) <= MaxDist) { //call function here } } }

Viewing all articles
Browse latest Browse all 1488

Trending Articles



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