Question by
Nombyy · Jul 02, 2017 at 01:45 AM ·
c#scripting problemcollisiongameobjectposition
Detect overlapping objects 2D game
I need to be able to detect when objects are overlapping each other for a game with 2D sprites.
Other answers I've been reading are suggesting the use of colliders as triggers but my game uses raycast to select objects and allow the user to move the selected objects around, so we have the smaller objects on a lower z plane than the bigger objects so that our selection raycast won't get blocked. However since they're on different planes now I'm under the impression that the colliders for the small objects aren't touching the bigger objects so we can't use it as a trigger.
I've thought about comparing their position xy coordinates but the sprites are all irregular shaped so I'm not sure if that would work.
Thanks for the help!
Comment