C# - Detecting if mouse is in the bounds of a sprite in world space

I’m currently working my way through an old project as a learning experience, and I’ve run into a problem. It’s for a top down strategy game.
Everything in it has been built to rely on 3D collisions - mostly just cubes and capsules that contain a series of sprites in world space (not on a canvas). However, there are some complex areas (essentially buildings) that have odd shapes too them where these basic colliders don’t do the job.
It appears the 2D collider that I was hoing to use to detect when these buildings are selected locks the co-ordinates to in world X and Y, while as the game is top down the sprites are being shown on the X and Z axis, with the camera looking down at them.
The options I can see are:

  • Flip the entire game 90 degrees to align with the 2D colliders
  • Build some custom shapes in Blender and hope to align them with the sprite

Both of these feel like very time consuming options, and I’m really hoping there’s a feature I’m not aware of that’s essentially an input mask for an OnMouseOver / OnPointerOver events based on the transparency of a sprite.

You can always use multiple colliders at once for any given shape, such as two or three boxes to approximate the clickable area of a single building.

Ideally you write your click-check code so it looks on the GameObject where it hit the collider and uses that to find what it clicked.

And if the building is REALLY crazy shaped, just make a mesh (either in Blender3D or ProBuilder) and turn off the MeshRenderer and use the MeshCollider to hit that mesh instead.