I have a Canvas
with a large Image
component. Now I place two child objects under that Image
component (2D sprites).
How can I check whether or not the two objects intersect?
(without using any physics, mesh colliders, etc ideally)
My main problem is that I don’t understand how to get the coordinates of the bounding boxes of both objects in the coordinate system of the parent Image
component.
Easiest for me would be to work with relative coordinates, i.e. the parent game object should provide a coordinate system from 0..1
for both x
and y
direction.
Any idea how to make each of the sprites “live” in that “0…1” coordinate system of it’s common parent?