#trying to SetActive a gameobject to everyone
3 messages · Page 1 of 1 (latest)
[ObserverRpc(BufferLast=true, RunLocally=true)] void ObserverSetActive(bool isActive) {
gameObject.SetActive(isActive);
}
Basically like this and then you can call it from the Server side, if its from client side, you need to do a ServerRpc before and in the ServerRpc you call then the ObserverRpc.
RunLocally make sure that the server also execute this, so you dont need duplicated logic. BufferLast make sure, that the recent changes get transfered to new observer clients
@vivid dawn thanks brother thats very helpful