#How to properly use observers.

34 messages · Page 1 of 1 (latest)

nimble pier
#

I am having a dedicated server , like my server is single instanced only .I have a persistent scene for lobby rooms, matchmaking etc, when clients connect to this server they can choose the appropriate game mode and launch a stacked scene version of the mode.
Now I am having scene mismatch errors when others player join primarily because sytacked scenes are laoded. What isa the appropriate setup for observers so that this is handled gracefully

teal hollow
#

Thus if a client is not added to a given stacked scene, he not received messages from scenes he is not in. Which is the most common source of this kind of error.

#

If you have overridden this SceneCondition on the prefab itself, you re-introduce the potential issue.

nimble pier
#

Okay technically what I want to achieve is that my stacked scene also have some network objects I am using for something. Is it possible that my stacked scene network objects are not observed by other clients , only the clients who are prt of that stacked scene

#

How will the condition look for them ?

teal hollow
nimble pier
#

I tried the above but still gets the same error with network objects

#

If I remove all network objects then it works fine even with stacked scenes

teal hollow
#

any network object, not just prefab actually

nimble pier
#

Yes so what should I do so that network objects are observed by the clients that are stacked scene versions only ?

nimble pier
#

Are there any tutorials or example projects where you have created a custome obsrver condition ?

teal hollow
teal hollow
nimble pier
#

I tried with scene condition. It is not working. What I meant is if I had to use matchcondition how do I customise the parameters such as connection, match etc

#

Like create a completely new scriptable object ?

#

Or refer them in my game manager and change function parameters

#

Do you guys have a sample project where you have use observers and conditions extensively ?

#

Or have handled multiple scenes with network object and scene stacking component together ?

teal hollow
teal hollow
nimble pier
#

But Lobby and world do not have multiple scenes with Network object in both of them. The Game scene do not have any network object.

nimble pier
#

The player spawn and remain in the main scene only not in stacked scene. I am abel to replicate the same but I need like if I had a networked object in my scene, how do I make sure only selected connections observe that

#

Let me try the inhertiance way

teal hollow
#

Once again. If the condition is missing, it's because you are overriding it on the object itself in the observer component

teal hollow
nimble pier
#

This works if there are no network objects in the scene I am instancing other than it start throwing all sorts of exceptions. Maybe inheriting and overriding is the way to go

teal hollow
nimble pier
#

I re ran the king of hell project I get what you are saying let me have a spin again maybe I got it confused somewhere

#

@teal hollow When players spawn are they spawned in persistent scene and moved to stacked scene or they are spawned in the instanced scene only for king of hill project ?