so I tried some different things here with the 2DSprite System and when I finished some basic behaviour I realised: “hey my touch hits sometime this and sometimes another object”.
So the raycast hits considering the Z Axis (hitting the positive ones last) Seems like its intended because the colliders for the raycast are independent from the sprite layers.
Has someone Information about this matter? Like if the 2D colliders will be sorted in Layers as well sometime in future per update I mean I dont want to handle the Z axis at all when I work in 2D space! And the awesome sprite layer say we intend to work on Z = 0;
I’m interested in this but I’m unclear as to what exactly your complaint is.
If you have multiple colliders on the same physical layer occupying the same 2D space, you have other issues, really.
Why not just exclude the layers you don’t want the Raycast to hit by specifying a LayerMask? No, the physical layers aren’t tied to the sprite layer order… but that’s intentional. You just have to start thinking of your physical interactions as being separate from the Sprites system. You can still categorize objects all you want via the physical Layers system, and have your Raycast look for specific Layers only.
Its because the touch is completely independend from the other behaviour and scripts!
Every object reacts different on the touch. I already have a layer system but if I want to spawn something with a click (if I am in a special state) I should be able to hit the ground and in other states I should be able to hit only the objects in front of the ground. (Manipulating the Layers during runtime is not an option in my opinion)
Well I didn’t say its bad. I mean the Z axis made exactly what I wanted
I just said it would be awesome if manipulating the Z axis wouldn’t be nessecary