Why is it that the Bounds.Intersects DOES NOT WORK if the gameobjects are rotated?
While testing the intersection of two cube gameobjects I noticed that when they were neither of them was rotated, the Bounds.Intersects was working just fine. But when either of them or both was rotated to my surprise I noticed the Bounds.Intersects ceased to work.
Answer by Dragate · Dec 04, 2017 at 12:30 PM
I believe it has to do with Bounds' representation of a AABB.
An axis-aligned bounding box, or AABB for short, is a box aligned with coordinate axes and fully enclosing some object. Because the box is never rotated with respect to the axes, it can be defined by just its center and extents, or alternatively by min and max points.
Thanks, Dragate.
I see what you mean. The Bounds.Intersects works just fine if the two rotated objects are not very close; when they are close, almost touching but not quite, then the Bounds.Intersects doesn't. If I want extreme precision, even hairline precision, how could I solve the problem?
Do I have to make calculations to redefine each object's boundaries using their center and extends or by $$anonymous$$ and max. But how could Ido that?
Could I use ClosestPointOnBounds ins$$anonymous$$d?
I don't know how you could achieve this. Hopefully, someone else can help you.
Your answer
Follow this Question
Related Questions
How to make a first-person player for my game (like slender or the island demo) 4 Answers
How fix colour ?? 1 Answer
So... why is Input not highlighting up when I type it? 2 Answers
3D Grappling Hook shape skewing *PLZ HELP* 0 Answers
Unity takes around 30 mins to open a new 2d project,Unity takes way too long to open a new project 0 Answers