Quantcast
Channel: Latest Questions by Hijackedbrain
Viewing all articles
Browse latest Browse all 14

How to detect if an object is above another one

$
0
0
Hello, I'd like to know if there is a way to detect if an object is above another one. But please keep in mind that I'm working in a 3D Space, raycast is a "no no" it would cost too much to cover the whole surface, and add a collision box would be a bad idea because of reasons (too long to explain here) .... Also, my objects are both rectangulars. So basically I was thinking about "creating" a Rect on the top surface of the object below and then use Rect.Contains ( http://docs.unity3d.com/ScriptReference/Rect.Contains.html ) and project the origin of the other cube on my Rect. But I know it's stupid but I can't figure out how to correctly instantiate the Rect. So please help me figure out how to instantiate Rect, or tip me another solution. Thanks for reading, and more thanks to whoever will respond. EDIT: ok so by the time this question has been moderated, I figured out I could use the bounds.Contains of my object below instead of creating a Rect. Also, it took easily 30+ hours to moderate this question... seriously what takes so long? I know it's free community yadi yada but guys... why ? stackoverflow works great without this moderation step. No anger, just trying to understand.

Viewing all articles
Browse latest Browse all 14

Latest Images

Trending Articles





Latest Images