When a client connects to my server, they grab the camera from the scene, which is in a default spectator view, and attach it to their character. I’m setting the parent of teh camera as so. When that clients disconnects, I try to detatch only the camera by setting its parent to null in OnDestroy() but it shows in the inspector with all its components switched off.
Are there asynchronous engine shenanigans happening where the camera object is being “partially” destroyed when the script logic finally sets its null parent?
Where is this code option ypu speak of? I can’t find it.
Same results using Transform::smile:eatchChildren(). In the script reference the detahment is happening before a Destroy is called. Where and how would I insert my code to run before networking calls Destroy from a disconnect?
Also I can’t use DetachChildren because it will detach other children that should be destroyed with the parent.
I’m not disabling anything. The engine just decides to disable my camera’s components when I unparent it in the OnDestroy call. The code above is all that affects the camera.