Search Issue Tracker
Won't Fix
Votes
1
Found in
2021.3.25f1
2022.3.0f1
2023.1.0b18
2023.2.0a16
Issue ID
UUM-41517
Regression
No
Physics.Raycast fails to detect collisions when Navmesh Agent's position is set to NaN
How to reproduce:
1. Open the user’s attached project “Bug Test.zip”
2. Build And Run
Expected result: Raycast detects collision by turning the “Sphere” GameObjects green
Actual result: Raycast does not detect collision by turning the “Sphere” GameObjects red
Reproducible with: 1.0.0-exp.4 (2021.3.25f1), 1.1.3 (2022.3.0f1, 2023.1.0b18, 2023.2.0a16)
Could not test with: 2020.3.47f1 (IL2CPP exception error when trying to build)
Reproduced on: Windows 10
Notes:
- Not reproducible when removing the Vector3.one division by 0 in "Test.cs"
- Issue reproduces only with a Navmesh Agent present in the project
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Build fails when building a project containing an 18+ dimension array with IL2CPP
- [Android][Sentis] Human poses are not detected when using the BlazePose model
- Sprite Editor Outline Tool Overlay is not displayed when no Sprite is selected
- “No method with RuntimeInitializeOnLoadMethod attribute” warning from ReadmeEditor.cs is thrown after installing Project Auditor Rules
- Projection matrix is altered when using RasterCommandBuffer.ClearRenderTarget on DX12 and Metal
Resolution Note:
Up on closer examination, we have to conclude that deliberately putting objects to NaN, infinity, or very large positions is not exactly supported by the physics engine in use today (PhysX). In the current versions, it's known to cause hits missed because of the issues arising in the spatial search trees up on the presence of such objects. It's not something that can be fixed at this moment, unfortunately, and in the newer Unity versions we explicitly disallow setting infinite positions to transforms (there'll be an error and the position will be discarded). We hope that in your particular project there is a way to avoid relying on invalid positions still being somehow processed without artefacts.