I am currently working on a new scene for a 2D point and click adventure and I have a little issue. In the scene I have a collider covering the whole Scene to allow the player clicking everywhere and letting the character move to the closest spot (using a nav mesh an AI path finder and a seeker script for tracking the MousePosition). Now I added a second collider for an Item wich obviously is at the same place as the ground collider. Now my Question: Can I somehow add Layers or something to the colliders to decide in which row they are so the RaycastHit hits the Item collider at first, becouse it doesnt do anything but hitting the ground collider?
Please give an answer a real noob can understand XD
ps: If you need any more information pls tell me but I think my issue is understandable somehow.
Know that in 2D a raycast “into” the screen doesn’t make any sense because there is no Z at all so it’s just a point and a degenerate ray. In 2D it’s Physics2D.OverlapPoint.