My application has a MapEditor (Offline) feature.
The data of the objects is stored in JSON, this scene data will be synced via the network. During gameplay, for static objects that do not need to be synced, each client will generate it locally from its JSON data...
Now the problem is with objects like doors that need to be synced,
in the networking solution that I previously used we can make the client set its NetworkObject Id from the data in JSON, so each client will set the network object Id with the same data, then after that initialize each object manually,
What is the best way to handle this in fishnet?
#Scene Network Object Custom Id
14 messages · Page 1 of 1 (latest)
Hi there, you should be able to set the scene ID using the NetworkObject.SetSceneId method
Can this method be called at any time?
Well, I believe it should be called before the object is initialised
hmmm, so does that mean I need to handle it inside a custom SceneProcessor? or is it enough when SceneManager.OnLoadStart is triggered?
I can't say I've tried it tbh, it's a rather uncommon thing to need
ah ok, i will try it first 👌
what triggers the scene NetworkObject to be initialized? and when is this process done?
we don't need to call ServerManager.Spawn() right?
You don't need to call Spawn, correct.
I don't know the underlying event flow that causes the objects to be initialized. I would need to look at the code to see what calls what
I saw your conversation about this earlier, is this related?
i am not sure, whether it is a scene NetworkObject or not
Ah yeah, that would be related yeah. So if your scene is being created at run-time you may need to call Spawn
hmm so i need to create it as a prefab and mark it as Spawnable? so its not a scene NetworkObject anymore
ahh, after looking deeper I think RebuildObservers can be used for this