Skip to content

Key already exists exception when enter play mode options is on in 1.5.2 #2647

@Xajaxaja

Description

@Xajaxaja

Description

A blank unity project with enter play mode options enabled and domain reload off, throws an exception for every network behavior in the project.

The stack-trace highlights even built in network behaviors like networkanimator or networktransform.

ArgumentException: An item with the same key has already been added. Key: 1665640498
System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <eef08f56e2e042f1b3027eca477293d9>:0)
System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) (at <eef08f56e2e042f1b3027eca477293d9>:0)
Unity.Netcode.Components.NetworkAnimator.InitializeRPCS_NetworkAnimator () <0x26f88a73b30 + 0x000ca> in <b476fa4747044164bbf4bd8f8f4d4d2e>:0

A clear and concise description of what the bug is.

Reproduce Steps

  1. Create a blank unity project in 2022.3.5f1 (URP core)
  2. Install netcode for game objects version 1.5.2
  3. Install parallel sync via github link https://github.com/VeriorPies/ParrelSync.git?path=/ParrelSync
  4. Go to project settings and enable "Enter Play Mode Options", ensure that "Reload Domain" is off.
  5. Enter play mode once, then exit.
  6. Enter play mode again and 2 exceptions should appear. One for NetworkTransform and one for NetworkAnimator.

Actual Outcome

No error

Expected Outcome

One exception for each networkbehavior in the project.

Screenshots

image

Environment

  • OS: Windows 10
  • Unity Version: 2022.3.5f1
  • Netcode Version: 1.5.2

Additional Context

Error does not appear if the netcode version is downgraded to 1.4.0, or 1.5.1

Metadata

Metadata

Assignees

Labels

priority:highThis issue has high priority and we are focusing to resolve itstat:importedStatus - Issue is tracked internally at Unitytype:bugBug Report

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions