- Home /
What does Physics2D.Raycast return?
Imagine you have 10 or more GOs with colliders on them, at same position but different sorting layers(just to note I know the option ignore layerMask or so).
So, what does the Raycast method return when executed over all these GOs? Does it always return the topmost(from the direction that is released) or the last one or a random one?
Comment
Have you made some tests? Raycasting 1000 times? Changing sorting layer of one of them? Changing order in hierarchy?