Change the Disconnect hook to OnStopClient so it is also triggered when the client is kicked or the server drops the session.
Make it toggleable even while dead, e.g, properly disables noclip when disconnecting while dead.
Mark the network object DontDestroyOnLoad so that noclip doesn't disable itself when changing scenes, e.g., with set_scene and next_stage. Teleporting out would retain noclip only because the body would have been destroyed by the time it'd try to toggle it.
Sanity check, players who join midrun still get the network object if spawned only once at the beginning of the network session, right? I tested multiplayer locally and with DropInMultiplayer and it behaves as expected.
This is mainly about
noclip
behaviour:set_scene
andnext_stage
. Teleporting out would retain noclip only because the body would have been destroyed by the time it'd try to toggle it.Sanity check, players who join midrun still get the network object if spawned only once at the beginning of the network session, right? I tested multiplayer locally and with DropInMultiplayer and it behaves as expected.