Search Issue Tracker
Fixed in 5.6.0
Votes
0
Found in
5.5.0b7
Issue ID
838681
Regression
Yes
Script updater updating incorrectly when an object is named like a class and the class becomes static
To reproduce:
1. Open attached project in 5.4
2. Notice that line 107 of the script RPGController.cs creates an object of type NavMeshAgent called NavMeshAgent
3. Notice that lines 629 and 630 refer to this object like this:
if (NavMeshAgent.remainingDistance <= NavMeshAgent.radius + 0.1F ||
(!NavMeshAgent.pathPending && NavMeshAgent.remainingDistance <= NavMeshAgent.stoppingDistance &&
(!NavMeshAgent.hasPath || NavMeshAgent.velocity.sqrMagnitude == 0f)))
4. Open the attached project in 5.5, and let the script updater do its work
5. Notice that lines 629 and 630 get changed to this:
if (NavMeshAgent.remainingDistance <= NavMeshAgent.radius + 0.1F ||
(!NavMeshAgent.pathPending && NavMeshAgent.remainingDistance <= NavMeshAgent.stoppingDistance &&
(!NavMeshAgent.hasPath || UnityEngine.AI.NavMeshAgent.velocity.sqrMagnitude == 0f)))
The important part here is that NavMeshAgent.velocity.sqrMagnitude (an object) gets changed to UnityEngine.AI.NavMeshAgent.velocity.sqrMagnitude (a static class), producing incorrect results and compilation errors.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [Android][BiRP] Depth processing is handled incorrectly on certain Android devices when using 2 camera's
- [APV] Cancelling Display Dialog Error is thrown after Adaptive Probe Volumes tab is open in Lighting Window
- [APV] NullReferenceException is thrown when baking Adaptive Probe Volume for a Terrain with Non-GI Contributing Tree Prototypes and multiple APV objects with different LayerMasks are present on the scene
- Hands are not recognized when using Hololens 2
- "OnTriggerExit2D" is called before "OnTriggerEnter2D" when object is destroyed immediately
Add comment