Cheo
Active member
Hello, I'm posting this in the Agility section because this issue occured with the Hang and Vault abilities, but it may be wider than that since it started with 3.0.9 which introduced a new ground detection method. Here's a video explaining the issue :
Here is the full stack trace of the error if it helps :
I don't know if anybody else got this error recently ? In any case I hope someone can help because I can't really make sense of it, the character's capsule collider should simply pass through the vault object while the ability is active I guess.
Edit : DankP3 tried to help me on Discord but we couldn't get to the bottom of it. One thing I should add though is that my character can perform a vault over objects that are not penetrated by others. So if I use a simplified version of the building's collider which does not contain the barriers then my character can vault over the vault object with no problem. And if I then add a long cube to replace the barriers, the issue happens again. So it's not a matter of collider complexity but simply about a collider being inside of a vault object.
Dank suggested I should use a specific layer for vault objects, but that did not prevent the error from happening and I was using Object IDs to begin with, which must have greatly reduced the detection counts.
Here is the full stack trace of the error if it helps :
Code:
[Exception] ArgumentException: An item with the same key has already been added. Key: UnityEngine.RaycastHit
System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert() at <5d4cbfbeb62e454f98e19b231866113e>:0
System.Collections.Generic.Dictionary`2[TKey,TValue].Add() at <5d4cbfbeb62e454f98e19b231866113e>:0
CharacterLocomotion.DetectGroundCollision() at /Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:1190
1189: if (m_ColliderCount > 1) {
-->1190: m_ColliderIndexMap.Add(closestRaycastHit, colliderIndex);
1191: }
1192: } else {
CharacterLocomotion.UpdateCharacter() at /Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:578
577: // Is the character still on the ground?
-->578: DetectGroundCollision();
580: // Set the new position.
UltimateCharacterLocomotion.UpdateCharacter() at /Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:588
586: }
-->588: base.UpdateCharacter();
590: // Update the animations.
CharacterLocomotion.Move() at /Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:545
543: EnableColliderCollisionLayer(false);
-->545: UpdateCharacter();
547: EnableColliderCollisionLayer(true);
SimulationManager+CharacterComponents.Move() at /Opsive/UltimateCharacterController/Scripts/Game/SimulationManager.cs:61
59: Handler.GetRotationInput(horizontalMovement, forwardMovement, out deltaYaw);
60: }
-->61: Locomotion.Move(horizontalMovement, forwardMovement, deltaYaw);
62: }
63: }
SimulationManager.MoveCharacters() at /Opsive/UltimateCharacterController/Scripts/Game/SimulationManager.cs:261
259: {
260: for (int i = 0; i < m_Characters.Count; ++i) {
-->261: m_Characters[i].Move(preMove);
262: }
263: }
SimulationManager.FixedUpdate() at /Opsive/UltimateCharacterController/Scripts/Game/SimulationManager.cs:229
227: MoveCharacters(true);
228: RotateCameras();
-->229: MoveCharacters(false);
230: MoveCameras();
231: }
I don't know if anybody else got this error recently ? In any case I hope someone can help because I can't really make sense of it, the character's capsule collider should simply pass through the vault object while the ability is active I guess.
Edit : DankP3 tried to help me on Discord but we couldn't get to the bottom of it. One thing I should add though is that my character can perform a vault over objects that are not penetrated by others. So if I use a simplified version of the building's collider which does not contain the barriers then my character can vault over the vault object with no problem. And if I then add a long cube to replace the barriers, the issue happens again. So it's not a matter of collider complexity but simply about a collider being inside of a vault object.
Dank suggested I should use a specific layer for vault objects, but that did not prevent the error from happening and I was using Object IDs to begin with, which must have greatly reduced the detection counts.
Last edited: