x


Network Instantiate cannot find prefab in client

Hi,

I made two different projetcs, one for the server and another for client. The server is calling Network.Instantiate every time a client connects, but this is giving me the following erros in client.

Network.Instantiate on the receiving client failed because the asset couldn't be found in the project

I have the same prefab on the client project. By the way, I clonned the whole scene from the server project, so why it don't find the prefab?

When I run two instances of the same project is works. Is there a problem using Network.Instantiate with diferent projects? Even if the scene is the same in the two projects? Should I instantiate using RPCs instead?

thx.

more ▼

asked Nov 09 '10 at 11:28 PM

Wagner Schmitt gravatar image

Wagner Schmitt
2 2 2 2

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

Hi there, i dont know if you're having the same problem, but I ran into a similar issue and resolved it. first though:

the design that you're going for is almost certainly a bad idea. DO NOT branch your build unless you have a really, really, really good reason to do so. Networking in unity is designed to be handled from the same build. I dont know what you're trying for, but it could very well be that you don't understand the networking system in unity.

ANYWAY. the solution. you need to be using external revision control with unity, so that it stores a .meta file next to every asset in your assets directory. find this meta file for the prefab you want and edit it in a text editor. that guid entry that you see needs to match on both builds. this is how unity identifies that the objects are, in fact, the same...

more ▼

answered Feb 18 '11 at 08:07 PM

hypnoslave gravatar image

hypnoslave
436 12 16 25

(comments are locked)
10|3000 characters needed characters left
more ▼

answered Jun 04 '12 at 01:51 PM

benni05 gravatar image

benni05
326 2 3 11

(comments are locked)
10|3000 characters needed characters left

the power of compiler stupidity. create a public reference to the game object at BOTH client and server, so it doesn't get deleted at build time like "eh, i think i don't need that prefab"

more ▼

answered Nov 25 '12 at 05:41 PM

shame gravatar image

shame
30 1 2 4

(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:

x1726
x1286
x733
x276
x130

asked: Nov 09 '10 at 11:28 PM

Seen: 2131 times

Last Updated: Nov 25 '12 at 05:41 PM