• Opsive has been nominated for TWO Unity Awards: Publisher of the Year and Best Development Tool (Behavior Designer Pro)! Your support means everything, cast your vote here: https://awards.unity.com/vote

Ladders can't be climbed in 3.1.3

Cheo

Active member
Hi, an error gets thrown when we try climbing one of the ladders in the climbing demo scene in UCC 3.1.3 :


Here's the error :

C#:
[Exception] NullReferenceException: Object reference not set to an instance of an object
DetectObjectAbilityBase.set_DetectedObject() at /Opsive/UltimateCharacterController/Scripts/Character/Abilities/DetectObjectAbilityBase.cs:116
 114:  }
 115:  if (m_MoveWithObject && m_CharacterLocomotion.MovingPlatform == m_DetectedObject) {
--> 116:      m_CharacterLocomotion.SetMovingPlatform(DetectedObject.transform, true);
 117:  }
 118:  m_DetectedObject = value;

DetectObjectAbilityBase.CanStartAbility() at /Opsive/UltimateCharacterController/Scripts/Character/Abilities/DetectObjectAbilityBase.cs:211
 209:  var hitObject = m_RaycastResult.collider.gameObject;
 210:  if (ValidateObject(hitObject, m_RaycastResult)) {
--> 211:      DetectedObject = hitObject;
 212:      return true;
 213:  }

TraversalClimb.CanStartAbility() at /Opsive/UltimateCharacterController/Add-Ons/Climbing/Scripts/TraversalClimb.cs:60
  58:  public override bool CanStartAbility()
  59:  {
-->  60:      if (!base.CanStartAbility()) {
  61:          return false;
  62:      }

LadderClimb.CanStartAbility() at /Opsive/UltimateCharacterController/Add-Ons/Climbing/Scripts/LadderClimb.cs:158
 156:  }
--> 158:  if (base.CanStartAbility()) {
 159:      m_ClimbState = ClimbState.BottomMount;
 160:      return true;

UltimateCharacterLocomotion.TryStartAbility() at /Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:843
 842:  // Start the ability if it is not active or can be started multiple times, enabled, and can be started.
--> 843:  if ((!ability.IsActive || ability.CanReceiveMultipleStarts) && ability.Enabled && (ignoreCanStartCheck || ability.CanStartAbility())) {
 844:      // The ability may already be active if the ability can receive multiple starts. Multiple starts are useful for item abilities that need to be active
 845:      // over a period of time but can be updated with the input start type while active. A good example of this is the Toggle Equip Item ability. When

UltimateCharacterLocomotionHandler.TryStartAbility() at /Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotionHandler.cs:226
 224:  protected virtual bool TryStartAbility(Ability ability)
 225:  {
--> 226:      return m_CharacterLocomotion.TryStartAbility(ability);
 227:  }

UltimateCharacterLocomotionHandler.UpdateAbilityInput() at /Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotionHandler.cs:133
 131:      // they are still running (such as toggling an equipped item while waiting for the animation to do the equip).
 132:      if (abilities[i].CanInputStartAbility(m_PlayerInput)) {
--> 133:          TryStartAbility(abilities[i]);
 134:      }
 135:  }

UltimateCharacterLocomotionHandler.UpdateAbilityInput() at /Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotionHandler.cs:100
  99:      // Update the input for both the regular abilities and item abilities.
--> 100:      UpdateAbilityInput(m_CharacterLocomotion.Abilities);
 101:      UpdateAbilityInput(m_CharacterLocomotion.ItemAbilities);
 102:  }

UltimateCharacterLocomotionHandler.Update() at /Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotionHandler.cs:75
  73:  protected virtual void Update()
  74:  {
-->  75:      UpdateAbilityInput();
  76:  }

Hope this can be fixed, thanks.
 
Thanks, if you add a m_DetectedObject != null to that if statement just before the line that throws the error it should fix it.
 
Back
Top