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
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
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.