x


NetworkViewID set to 0 at Start

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.

more ▼

asked Jul 04 '12 at 05:45 PM

NWegener gravatar image

NWegener
67 2 3

So you aren't instantiating this prefab - it is just part of the scene?

Jul 04 '12 at 05:51 PM whydoidoit

yes, just part of the scene.

Jul 04 '12 at 05:53 PM NWegener

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.

Jul 04 '12 at 05:59 PM Bunny83

@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.

Jul 04 '12 at 06:08 PM NWegener

Okay, found a Solution and posted an answer, thanks for your efforts.

Jul 04 '12 at 06:16 PM NWegener
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Jul 04 '12 at 06:16 PM

NWegener gravatar image

NWegener
67 2 3

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x711
x116

asked: Jul 04 '12 at 05:45 PM

Seen: 465 times

Last Updated: Jul 04 '12 at 06:16 PM