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
- Sprites are not generated when using Fallback Sprite Assets
- Spot light with high Outer Spot Angle produces artefacts/clipping when using the Forward+ Rendering Path
- NullReferenceException is thrown when selecting a Diffusion Profile
- Colliders of GameObject with Rigidbody component fail to collide with another GameObject when Rigidbody becomes Kinematic
- Shader cache uploads occur when the "Upload" parameter is disabled in the Cache Server settings
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.