Issue-3742
{}The given key 'EnemyAnimations' was not present in the dictionary{}_ after upgrading to netcode 2.6.0. happens when we try to send an rpc from SPAWNED network behaviour
Steps to reproduce:
The steps to reproduce: (v2.6 or v2.7)
- Create a generic project that includes
- NGO v2.6 or v2.6
- MP Tools (latest version is fine)
- Create a scene.
- Add NetworkManager and disable scene management
- Setup a player prefab
- In the player prefab make sure there is a NetworkBehaviour that invokes an RPC on another NetworkBehaviour on the player prefab (has to be 2 NetworkBehaviours)
- Make sure the RPC will be invoked immediately (i.e. SendTo.Owner will do this)
- Make sure the NetworkBehaviour that invokes the RPC is:
- Above the NetworkBehaviour that contains the RPC. (screenshot)
- The RPC is invoked during OnNetworkSpawn.
- Enter play mode
- Start as the host
Actual results:
An exception will be thrown when the RPC is invoked.
Expected results:
No exception should be thrown.
Reproducible with versions:
v2.6.0 & v2.7.0
Not reproducible with versions:
v.2.5.1 (and below)
Can’t test with versions:
Environment:
- OS: [Windows 11]
- Unity Version: [6000.2.9f2]
- Netcode Version: [2.6.0]
- Netcode Topology: [Client Server]
Notes:
A replication project has been added to this ticket and can be used to confirm the fix.