ClientSim
ClientSim copied to clipboard
[1.1.2] Remove EditorOnly on prefabs with Project settings Enter Play Mode Options enabled crashes ClientSim before starting
When using ClientSim's Remove EditorOnly feature, it will throw an exception when trying delete prefab children objects.
Requirements:
- Create a prefab that has a child object tagged as "EditorOnly" and place it in the scene
- Have Remove "EditorOnly" enabled in ClientSim settings
- 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)