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

SphereCastAll sees for miles

$
0
0
Hey Guys and Girls, I am using this line of code hits = Physics.SphereCastAll(transform.position,transform.localScale.x / 3,playerTransform.position - transform.position, Vector3.Distance(playerTransform.position, transform.position)); to help me enemies spot me! It works fine and all, but it does mean they can see me from literally hundreds of miles away. I tried writing the code like this, hits = Physics.SphereCastAll(transform.position,transform.localScale.x / 3,playerTransform.position - transform.position, 10000f); but then they don't seem to see me at all, I have to get right in there face for it to work! Can anyone suggest what I am doing wrong. Thanks in advance!

Viewing all articles
Browse latest Browse all 1488

Trending Articles