Minor Bug in V. 3.1

FadelMS

Member
After upgrading to 3.1, I got the following error:
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.UI.CrosshairsMonitor.OnAttachCharacter (UnityEngine.GameObject character) (at Assets/Opsive/UltimateCharacterController/Scripts/UI/CrosshairsMonitor.cs:174)
Opsive.UltimateCharacterController.UI.CharacterMonitor.Awake () (at Assets/Opsive/UltimateCharacterController/Scripts/UI/CharacterMonitor.cs:47)
Opsive.UltimateCharacterController.UI.CrosshairsMonitor.Awake () (at Assets/Opsive/UltimateCharacterController/Scripts/UI/CrosshairsMonitor.cs:115)

You receive this error if the Assist Aim ability is not added to the Character Abilities and the Auto Assign Assist Aim Target is checked.
The code in CrosshairsMonitor does not check for the null value of "m_AssistAim".
Code:
if (m_AutoAssignAssistAimTarget) {
              m_AssistAim.AutoSelectTarget = false;
   }
The solution is obvious:
Code:
if (m_AutoAssignAssistAimTarget && m_AssistAim!=null ) {
              m_AssistAim.AutoSelectTarget = false;
   }
 
Last edited:
  • Like
Reactions: EVG
That's a good catch. I'll push out an update that has this fix since it could get a lot of people caught off guard.

Edit: this update has been released.
 
Last edited:
Top