ClientSim icon indicating copy to clipboard operation
ClientSim copied to clipboard

[1.1.2] Remove EditorOnly on prefabs with Project settings Enter Play Mode Options enabled crashes ClientSim before starting

Open CyanLaser opened this issue 2 years ago • 0 comments

When using ClientSim's Remove EditorOnly feature, it will throw an exception when trying delete prefab children objects.

Requirements:

  1. Create a prefab that has a child object tagged as "EditorOnly" and place it in the scene
  2. Have Remove "EditorOnly" enabled in ClientSim settings
  3. In ProjectSettings/Editor, check "Enter Play Mode Options" and have "Reload Scene" unchecked

Observed:

  • ClientSim throws an error and fails to start

Expected:

  • ClientSim initializes and the child EditorOnly object is deleted without issue.

Full error text:

InvalidOperationException: Destroying a GameObject inside a Prefab instance is not allowed.
UnityEngine.Object.DestroyImmediate (UnityEngine.Object obj) (at <7d87237cea3743d093e22c5b98f74fba>:0)
VRC.SDK3.ClientSim.ClientSimRuntimeLoader.DestroyEditorOnly (VRC.SDK3.ClientSim.ClientSimSettings settings) (at Library/PackageCache/com.vrchat.clientsim@03a3097b91/Runtime/ClientSimRuntimeLoader.cs:112)
VRC.SDK3.ClientSim.ClientSimRuntimeLoader.StartClientSim (VRC.SDK3.ClientSim.ClientSimSettings settings, VRC.SDK3.ClientSim.IClientSimEventDispatcher eventDispatcher) (at Library/PackageCache/com.vrchat.clientsim@03a3097b91/Runtime/ClientSimRuntimeLoader.cs:89)
VRC.SDK3.ClientSim.ClientSimRuntimeLoader.OnBeforeSceneLoad () (at Library/PackageCache/com.vrchat.clientsim@03a3097b91/Runtime/ClientSimRuntimeLoader.cs:22)

CyanLaser avatar Apr 24 '22 13:04 CyanLaser