Hi,
i'm getting a KeyNotFoundException in CheckGround. As I understand the NonAllocCast method, the caller is responsible for calling ResetCombinedRaycastHits once the result of NonAllocCast is not needed anymore. Calling NonAllocCast without calling ResetCombinedRaycastHits could lead to the exception i've hit.
I think there are 2 missing calls to ResetCombinedRaycastHits. Maybe we should just call ResetCombinedRaycastHits in the beginning of NonAllocCast?
Thanks
i'm getting a KeyNotFoundException in CheckGround. As I understand the NonAllocCast method, the caller is responsible for calling ResetCombinedRaycastHits once the result of NonAllocCast is not needed anymore. Calling NonAllocCast without calling ResetCombinedRaycastHits could lead to the exception i've hit.
I think there are 2 missing calls to ResetCombinedRaycastHits. Maybe we should just call ResetCombinedRaycastHits in the beginning of NonAllocCast?
Thanks
Code:
diff --git a/Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs b/Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs
index dff566943..d712f950c 100644
--- a/Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs
+++ b/Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs
@@ -577,6 +577,7 @@ namespace Opsive.UltimateCharacterController.Character
break;
}
}
+ ResetCombinedRaycastHits();
if (!platformCollision) {
UpdateMovingPlatformTransform(null, false);
return;
@@ -1067,6 +1068,7 @@ namespace Opsive.UltimateCharacterController.Character
// Convert back to the global direction for CheckGround.
m_MoveDirection = m_Transform.TransformDirection(localMoveDirection);
}
+ ResetCombinedRaycastHits();
}
// Is the character on the ground?
Code:
KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <695d1cc93cca45069c528c15c9fdd749>:0)
Opsive.UltimateCharacterController.Character.CharacterLocomotion.CheckGround () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:1141)
Opsive.UltimateCharacterController.Character.CharacterLocomotion.DeflectVerticalCollisions () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:1073)
Opsive.UltimateCharacterController.Character.CharacterLocomotion.UpdatePosition () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:771)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.UpdatePosition () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:974)