FishNet: enabling/ disabling objects.

Hey Fishnet devs. Have a question that would solve a lot of issues I'm dealing with currently.

Is it possible for gameobjects to be set as active/disabled in the scene (mostly asking about child objects on the player) that can be observed across the network (haven't found a way of enabling/disabling gameobjects that is scene by the other clients), or is the only way to spawn/despawn the object or place off screen somewhere?

This is for situations such as (enabling specific objects on spawn, ragdolling on death, changing player components, etc.). Being able to enable/disable a gameObject would be helpful, so curious if it's even possible.

https://discord.com/channels/424284635074134018/1034477094731784302/1215103355853217792

Hope to hear back soon, thank you!

Through a thread on the wild west of help, I was told this can be done using a server/observer rpc. Going to give this a try, please let me know if there is a different way that would be better!

Typically speaking if you leave SceneCondition as the default conditions on the ObserverManager (as shown on the NetworkManager prefab) objects are automatically enabled/disabled based on client visibility.

Hey i was wondering it too. It can be achieved by using observersRpc or using a script that syncs isActive as a syncVar variable but i am wondering if fishnet has a built-in solution for that.


I don't know if anyone has been honest with you, but this is just not good. GameObjects with networkobjects on them are constantly not activated and you must go through hoops to make them work. It would be much better if things were activated by default and not the other way around. Also having to spawn a networkobject to actually allow your client to do anything is really painful.

The problem im currently having is with my LobbyManager with a networkobject on it. I switch scenes to the game scene, then when the game ends and i switch back, move the spawned networked gameobjects to the lobby scene, lo and behold my lobbymanager is deactivated on the client but working on the server. No idea how to make it turn on, its just gone. Even when its "on" in the UI , sometimes it;ll say client not activated, not initialized, when I try to use RPC's, synclists, whatever. I think the moment I've connected to the server I should be able to run any rpc and use any sync variable without having to worry about this, and I don't see why it can't be that way. This is the biggest detriment i've come across with fishnet and I run into it constantly.

You don't have to disable the GameObject. You can simply disable the render-related components, or whatever components you want to be disabled. Use enabled on a component/script.

I may have misunderstood your question originally. You can disable/enable objects but only if they are MonoBehaviour, not NetworkBehaviour. Technically, you could probably still disable NetworkBehaviours(not NetworkObject) and be okay.

The object disabling on clients when it exists in a scene and the client does not is very much intentional and expected.

There is however an easy solution for this. You can just mark 'IsGlobal' on your LobbyManager prefab and spawn it when the server starts. Clients and server will always have it spawned no matter what.