|
I set up my Prefab with a NetworkView-Component. When I look at the Objects of the Prefab in the Unity-Editor, they all have a NetworkViewId and Type "Scene", however when I start the Game the NetworkViewIDs of all Objects of that Prefab become 0 and the Type changes to 'Allocated'. Naturally no State-Synchronisation or RPCs work. Nothing appears in the Console either. Does anybody know what is happening here? I would like to be more detailed but I have no idea what is happening here. I have other Prefabs with a NetworkView, but everything is working fine with them. I don't even know if this is a bug or if I am doing something wrong.
(comments are locked)
|
|
Wow, I just found the Solution for the Problem: The Objects that I had that problem with were in the Scene, before I gave the Prefab a NetworkView-Component. So after I deleted the Objects and put new Instances of them in the Scene it worked for the new Instances. Why that problem happened now and not before (as I had another Prefab where that worked fine), I do not know, but the important thing is I now know what to do if that happens again. Thanks to whydoidoit and bunny83 for trying to help.
(comments are locked)
|

So you aren't instantiating this prefab - it is just part of the scene?
yes, just part of the scene.
Do you have a prefab or a prefab instance? Prefabs are off scene objects which can be instantiated into the scene at runtime. So i guess you have a scene object which has a NetworkView with a Scene-NetworkViewID, right? Do you have actually a problem with the ID?
A NetworkViewID consists of 3 integer values (private members a, b and c). The value you get back by ToString is probably either one of the ints are calculated from them. However you shouldn't bother about the actual value, just take the ID as an ID-object You don't have to care about how it works internally. You can compare ViewIDs and determine it's owner, that should be enough.
@Bunny83: I put Instances of the Prefab into a Scene, and I actually have problems with the NetvorkViewID in the case of RPCs. An Example: I actually have two Objects with that Problem. One has the RPC-Function "pauseGameRPC" and the other does not. Now because both have the ID 0, the "pauseGameRPC"-Call is send to the one without that function.
Okay, found a Solution and posted an answer, thanks for your efforts.