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
#How to properly use observers.
34 messages · Page 1 of 1 (latest)
The way the Network Manager is setup by default is the correct setting for this application.
https://i.imgur.com/eV33AGU.png
Notably, the SceneCondition in ObserverManager.
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.
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 ?
Look at the screenshot above
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
^
any network object, not just prefab actually
Yes so what should I do so that network objects are observed by the clients that are stacked scene versions only ?
Are there any tutorials or example projects where you have created a custome obsrver condition ?
... see the above example 😛
search for t:ObserverCondition you'll see bunch of pre-made one, you can consider them examples and look how you have to implement the logic
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 ?
They are pretty simple, so I'm not sure if there is a more extensive use of them other than Lobby and World supporter project
You inherit from SceneCondition and you implement whatever logic you can imagine
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.
Yeah, the players
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
I know I've already answered this specific question multiple times, but once again, look at the example here:
#1023113597519417404 message
That is the ONLY condition needed to present to fulfil your requirements.
Once again. If the condition is missing, it's because you are overriding it on the object itself in the observer component
That's not how King of the Hill work though
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
I'm telling you no, but have at it.
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 ?