- HitActor currentHit( HitTestWithinLayer( GetImplementation(*iter), rayOrigin, rayDir, worldOverlay, nearClippingPlane, farClippingPlane, hitCheck, stencilOnLayer, stencilHit, isStencil ) );
-
- // If Current child is an overlay, then it takes priority.
- // If it is not an overlay, and the previously hit sibling is also not an overlay, then closest takes priority.
- // (last overlay sibling has priority as is rendered on top)
- if ( currentHit.distance >= 0.f && (currentHit.overlay || (!childHit.overlay && currentHit.distance < childHit.distance) ) )
+ HitActor currentHit( HitTestWithinLayer( GetImplementation(*iter),
+ renderTask,
+ exclusives,
+ rayOrigin,
+ rayDir,
+ nearClippingPlane,
+ farClippingPlane,
+ hitCheck,
+ stencilOnLayer,
+ stencilHit,
+ isStencil ) );
+
+ bool updateChildHit = false;
+ // If our ray casting hit, then check then if the hit actor's depth is greater that the favorite, it will be preferred
+ if ( currentHit.distance >= 0.0f )