1
\$\begingroup\$

Is it possible to check for a collision between gameObjects without using the built-in functions OnCollisionEnter, OnCollisionStay, or OnCollisionExit? Preferably a solution without the use of raycasting.

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

I have looked for this before and there is no easy, built in, way to do this. What I have done is in my objects that have a need for these checks to add a list and then on enter add to the list and on exit remove from the list.

Also, if you can be more specific as to why you want to check for a collision I may be able to provide a better answer... But it will still not be a built in solution.

\$\endgroup\$
2
  • \$\begingroup\$ I'm actually astonished this can't be done. I was planning on using unity for some motion planning experiments but couldn't find a clear answer on this either. Seems like a pretty big oversight. \$\endgroup\$
    – mklingen
    Commented Apr 6, 2015 at 21:07
  • \$\begingroup\$ Agreed - especially since they do keep track of all those objects somehow (OnCollisionStay) does this somehow. Why not give us access (read-only) to that list. \$\endgroup\$ Commented Apr 9, 2015 at 17:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .