Not signed in
Copyright © 2026 Unity Technologies
Thank you for reporting a bug to Unity. After reviewing the behavior, we've confirmed it aligns with the current design and intended use of the feature. We understand this may differ from your expectations or workflow. We will close this case as 'As Designed.' If you have feedback on how the feature could better meet your needs, please let us know - we value your input and consider it in future improvements. Additional information: The PhysX 4.1 SDK returns an array of hits consisting of all hits that were processed for a single query (raycasst/sweep etc), this is done by eTOUCH being provided to the query filter. The returned array is not sorted by distance from origin. Now looking at our RaycastCommand when it executes it will grab all colliders the ray will hit, but the ordering is not guaranteed in any way shape or form as such providing too few max hits can end up culling some of the results. For example for a line of 10 colliders the first 4-5 colliders might be randomly ordered between indices 0 - 4 when hits are being returned. I've noticed that this isn't mentioned in the documentation. I'll make sure to get it updated. Cheers, AlexRvn.
Unity 6000.2 has reached its end of life and will not receive further updates. If you need additional fixes, please upgrade to a newer Unity version.
How to reproduce:
1. Open the project “IN-111393_Raycasting Sample”
2. In the Game tab, make sure to enable Gizmos in the top right corner
3. Enter Play Mode
4. Click the button “Regenerate”, located in the top left corner to the Game tab
5. Observe the outlines on the cubes
Expected result: The second, third and fourth row cubes are highlighted due to the ray casting emitted from the first row of cubes
Actual result: Further away cubes are affected by ray casting while the closer cubes are unaffected
Reproducible with: 2023.1.0a1, 6000.0.56f1, 6000.2.1f1, 6000.3.0a5 (36d7e9fd6645)
Reproducible on: Windows 11
Not reproducible on: No other environments tested
Notes:
Sign in to see your voted issues