PUN and UCCLocomotion + Projectiles errors

Vlaxep

Active member
Howdy,

Have upgraded my project to Unity 2020.3.11f1 so I can upgrade to UCC Latest version.
Most things are working, but attempting to fire weapons I get two errors I believe are related as they occur upon firing.

It seems like the Pun Object Pooling is perhaps not working correctly somehow?

The projectiles do not fire correctly - what seems to occur based on what I've observed:

A 'single' shot results in error#1 below
An 'automatic' fire shot fires the entire clip despite releasing 'fire1' input, and results in both error#1 and error#2

------ERROR#1

NotImplementedException: The method or operation is not implemented.
Opsive.UltimateCharacterController.AddOns.Multiplayer.PhotonPun.Game.PunObjectPool.NetworkSpawnInternal (UnityEngine.GameObject original, UnityEngine.GameObject instanceObject, System.Boolean sceneObject) (at B:/== Unity Projects ==/dp44 11jun try 2020/Protocol 44 URP Copy 2/Assets/Opsive/UltimateCharacterController/Add-Ons/Multiplayer/PhotonPUN/Scripts/Game/PunObjectPool.cs:125)
Opsive.UltimateCharacterController.Networking.Game.NetworkObjectPool.NetworkSpawn (UnityEngine.GameObject original, UnityEngine.GameObject instanceObject, System.Boolean sceneObject) (at B:/== Unity Projects ==/dp44 11jun try 2020/Protocol 44 URP Copy 2/Assets/Opsive/UltimateCharacterController/Scripts/Networking/NetworkObjectPool.cs:53)
Opsive.UltimateCharacterController.Items.Actions.ShootableWeapon.ProjectileFire (System.Single strength) (at B:/== Unity Projects ==/dp44 11jun try 2020/Protocol 44 URP Copy 2/Assets/Opsive/UltimateCharacterController/Scripts/Items/Actions/ShootableWeapon.cs:842)
Opsive.UltimateCharacterController.Items.Actions.ShootableWeapon.Fire (System.Single strength) (at B:/== Unity Projects ==/dp44 11jun try 2020/Protocol 44 URP Copy 2/Assets/Opsive/UltimateCharacterController/Scripts/Items/Actions/ShootableWeapon.cs:774)
Opsive.UltimateCharacterController.Items.Actions.ShootableWeapon.UseItem () (at B:/== Unity Projects ==/dp44 11jun try 2020/Protocol 44 URP Copy 2/Assets/Opsive/UltimateCharacterController/Scripts/Items/Actions/ShootableWeapon.cs:694)
Opsive.UltimateCharacterController.Character.Abilities.Items.Use.LateUpdate () (at B:/== Unity Projects ==/dp44 11jun try 2020/Protocol 44 URP Copy 2/Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/Use.cs:638)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.LateUpdateActiveAbilities (Opsive.UltimateCharacterController.Character.Abilities.Ability[] abilities, System.Int32& abilityCount) (at B:/== Unity Projects ==/dp44 11jun try 2020/Protocol 44 URP Copy 2/Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1042)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.LateUpdateUltimateLocomotion () (at B:/== Unity Projects ==/dp44 11jun try 2020/Protocol 44 URP Copy 2/Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1028)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.UpdatePositionAndRotation () (at B:/== Unity Projects ==/dp44 11jun try 2020/Protocol 44 URP Copy 2/Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:843)
Opsive.UltimateCharacterController.Character.CharacterLocomotion.UpdatePositionAndRotation (System.Boolean fromAnimatorMove) (at B:/== Unity Projects ==/dp44 11jun try 2020/Protocol 44 URP Copy 2/Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:517)
Opsive.UltimateCharacterController.Character.CharacterLocomotion.OnAnimatorMove () (at B:/== Unity Projects ==/dp44 11jun try 2020/Protocol 44 URP Copy 2/Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:1453)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.OnAnimatorMove () (at B:/== Unity Projects ==/dp44 11jun try 2020/Protocol 44 URP Copy 2/Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1772)

------ ERROR#2

ArgumentException: An item with the same key has already been added. Key: MyVulcanProjectile(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 B:/== Unity Projects ==/dp44 11jun try 2020/Protocol 44 URP Copy 2/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 B:/== Unity Projects ==/dp44 11jun try 2020/Protocol 44 URP Copy 2/Assets/Opsive/UltimateCharacterController/Scripts/Networking/NetworkObjectPool.cs:53)
Opsive.UltimateCharacterController.Items.Actions.ShootableWeapon.ProjectileFire (System.Single strength) (at B:/== Unity Projects ==/dp44 11jun try 2020/Protocol 44 URP Copy 2/Assets/Opsive/UltimateCharacterController/Scripts/Items/Actions/ShootableWeapon.cs:842)
Opsive.UltimateCharacterController.Items.Actions.ShootableWeapon.Fire (System.Single strength) (at B:/== Unity Projects ==/dp44 11jun try 2020/Protocol 44 URP Copy 2/Assets/Opsive/UltimateCharacterController/Scripts/Items/Actions/ShootableWeapon.cs:774)
Opsive.UltimateCharacterController.Items.Actions.ShootableWeapon.UseItem () (at B:/== Unity Projects ==/dp44 11jun try 2020/Protocol 44 URP Copy 2/Assets/Opsive/UltimateCharacterController/Scripts/Items/Actions/ShootableWeapon.cs:694)
Opsive.UltimateCharacterController.Character.Abilities.Items.Use.LateUpdate () (at B:/== Unity Projects ==/dp44 11jun try 2020/Protocol 44 URP Copy 2/Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/Use.cs:638)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.LateUpdateActiveAbilities (Opsive.UltimateCharacterController.Character.Abilities.Ability[] abilities, System.Int32& abilityCount) (at B:/== Unity Projects ==/dp44 11jun try 2020/Protocol 44 URP Copy 2/Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1042)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.LateUpdateUltimateLocomotion () (at B:/== Unity Projects ==/dp44 11jun try 2020/Protocol 44 URP Copy 2/Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1028)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.UpdatePositionAndRotation () (at B:/== Unity Projects ==/dp44 11jun try 2020/Protocol 44 URP Copy 2/Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:843)
Opsive.UltimateCharacterController.Character.CharacterLocomotion.UpdatePositionAndRotation (System.Boolean fromAnimatorMove) (at B:/== Unity Projects ==/dp44 11jun try 2020/Protocol 44 URP Copy 2/Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:517)
Opsive.UltimateCharacterController.Character.CharacterLocomotion.OnAnimatorMove () (at B:/== Unity Projects ==/dp44 11jun try 2020/Protocol 44 URP Copy 2/Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:1453)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.OnAnimatorMove () (at B:/== Unity Projects ==/dp44 11jun try 2020/Protocol 44 URP Copy 2/Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1772)
 
btw this error does the yellow highlight on the Character instance for this error.

I'm also using Rewired integration if that's of any help, but no errors show relating to rewired.
 
Can you tell me how to reproduce those errors in a fresh project? NetworkSpawnInternal is definitely implemented :)
 
I'll have to go and create a fresh and work through. I've got so many assets integrated it could be so many things causing it.

I'll try that, but for now @Justin could you tell me where the process of calling that method begins?

The Unity yellow highlight indicator obviously just tells me it's on the Character object, but not where the method get's called 'from' when you try to fire a projectiles from a weapon!

To confirm, the demo scene works fine firing the weapons.

Also, am I supposed to recreate characters when upgrading UCC? I've left my scene and characters as is when updating.....
Or perhaps weapons and items as well?
 
The call stack that you posted indicates the flow for how it is called. Your top method is called from NetworkObjectPool.NetworkSpawn. I do not know why you are getting that exception since NetworkSpawnInternal is implemented in the released version.

Also, am I supposed to recreate characters when upgrading UCC? I've left my scene and characters as is when updating.....
Or perhaps weapons and items as well?
The release notes contain any changes that you need to make but you generally don't need to recreate.
 
@Justin solved this with some help from @Focus in Discord channel.

Problem was simply that Photon had not updated correctly as well!

Error pointed back to a line in either PunObject/NetworkObjectPool referencing AllocateRoomViewID,
which required the updated Photon PUN 2 Package.

Fixed both errors!
 
Anyone having same issue,

We traced the missing 'NotImplemented' error by using my IDE (Visual Studio) to do a search for the term 'NotImplemented', with 'Find All' and 'Entire Solution' parameters. Then noticed there was one in 'Photon'.
 
Top