Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

How to select only the enemies in a range as targets

$
0
0
Okay, I have a list of enemies public var enemies:GameObject[]; That include all of the enemies currently in the scene. I also have a list of targets: public var targets:GameObject[]; Which I would like to include all of the objects between a certain range/distance(example: from 5 feet away and at a 45 degree angle each direction.) How could I isolate only those objects? I am looking more for a method than the actual script, but if you feel obliged to do so, it will also be helpful. Thanks, Thor

Viewing all articles
Browse latest Browse all 171066

Trending Articles



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