Don't do depth compare on raycastresults unless they came from the same raycaster

#49 Declined
Repository
playdots
Branch
5.4
Repository
Unity-Technologies
Branch
5.4
Author
  1. Eddie Cameron
Reviewers
Description

Fixes Issue https://issuetracker.unity3d.com/issues/plane-distance-parameter-in-canvas-does-not-affect-raycasting-order

Currently, if RaycastResults from two canvases are compared, the result that had hit an object deeper in its hierarchy will count as the first hit, even if its canvas was further behind the other one.

Depth should only be compared on results that came from the same ray caster, otherwise the other parameters will determine which is the frontmost hit.

(Note: non-GraphicRaycaster don't set depth, so should be unaffected)

Comments (0)