Projectile with PUN

Hello. When shooting at a wall at point-blank range, a strange error occurs.

Message:
ArgumentException: An item with the same key has already been added. Key: PunAssaultRifleProjectile(Clone) (UnityEngine.GameObject)
System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) (at <695d1cc93cca45069c528c15c9fdd749>:0)
Opsive.UltimateCharacterController.AddOns.Multiplayer.PhotonPun.Game.PunObjectPool.NetworkSpawnInternal (UnityEngine.GameObject original, UnityEngine.GameObject instanceObject, System.Boolean sceneObject) (at Assets/Opsive/UltimateCharacterController/Add-Ons/Multiplayer/PhotonPUN/Scripts/Game/PunObjectPool.cs:119)
Opsive.UltimateCharacterController.Networking.Game.NetworkObjectPool.NetworkSpawn (UnityEngine.GameObject original, UnityEngine.GameObject instanceObject, System.Boolean sceneObject) (at Assets/Opsive/UltimateCharacterController/Scripts/Networking/NetworkObjectPool.cs:53)
Opsive.UltimateCharacterController.Items.Actions.ShootableWeapon.ProjectileFire (System.Single strength) (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Actions/ShootableWeapon.cs:908)
Opsive.UltimateCharacterController.Items.Actions.ShootableWeapon.Fire (System.Single strength) (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Actions/ShootableWeapon.cs:815)
Opsive.UltimateCharacterController.Items.Actions.ShootableWeapon.UseItem () (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Actions/ShootableWeapon.cs:725)
Opsive.UltimateCharacterController.Character.Abilities.Items.Use.LateUpdate () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/Use.cs:651)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.LateUpdateActiveAbilities (Opsive.UltimateCharacterController.Character.Abilities.Ability[] abilities, System.Int32& abilityCount) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1063)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.LateUpdateUltimateLocomotion () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1049)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.UpdatePositionAndRotation () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:864)
Opsive.UltimateCharacterController.Character.CharacterLocomotion.UpdatePositionAndRotation (System.Boolean fromAnimatorMove) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:527)
Opsive.UltimateCharacterController.Character.CharacterLocomotion.OnAnimatorMove () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:1504)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.OnAnimatorMove () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1792)

Video: https://drive.google.com/file/d/1jBC526pVDQCTvLkpIYHr9KC2UXraFt83/view?usp=sharing

Perhaps you can tell in which direction to debug, or where to look at what it is connected with.
 
Last edited:
Are you running the latest version of the PUN add-on? Are you able to reproduce it within a fresh project? In order to understand what is happening I'll need to be able to step through it.
 
Top