i was wondering if there was a way to grab every single object in a certain distance from an object (like if the range is 30, then every object that is 30 units or less away is used in the function).
what i want to do is add this to my bomb, i already have it set up to explode and all that, i just want it to say something like
if(Vector3.Distance(stuff in here to get distance)
later I'll add in some stuff saying like the farther you are from it the less damage you take, but for now just answer the question please :)
Even though probably this is not the most efficient way of doing something like that, I guess you want something like this:
To get the distance between two points in Unity you can use
Another way (and more efficient one) of achieving that is to use
answered Mar 11 '10 at 01:37 AM