x


Collision Checking

How do i check for collision without using OnTriggerEnter or OnTriggerExit, because these are only checking collision with moving objects inside their colliders for some reason. Is there anyother way to check for collision with specific gameObjects that are not moving and are already inside a collider?

more ▼

asked Apr 03, 2012 at 01:35 AM

avatar image

AJspartan
16 13 10 12

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

this might help : Returns an array with all colliders touching or inside the sphere.

http://unity3d.com/support/documentation/ScriptReference/Physics.OverlapSphere.html

example :

 var radius : float = 2.5;
 var objectsInRange : Collider[] = Physics.OverlapSphere(transform.position, radius);
 for (var object : Collider in objectsInRange) 
 {
     print (object.name);
 }


more ▼

answered Apr 03, 2012 at 02:54 AM

avatar image

alucardj
30k 169 1060 229

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x4491
x3861
x3164
x631
x309

asked: Apr 03, 2012 at 01:35 AM

Seen: 2253 times

Last Updated: Nov 09, 2012 at 05:26 AM