Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Network instantiate doesn't find assets on build

Discussion in 'Multiplayer' started by joaomesq_old, Jul 17, 2012.

  1. joaomesq_old

    joaomesq_old

    Joined:
    Nov 24, 2010
    Posts:
    2
    Hi all,

    I'm building a multiplayer framework for a project I'm working but I bumped into a weird problem.

    I have a server/client setup with two Unity instances loaded on a Mac.

    If I run the server on Unity editor, prefabs are run by network.instantiate, so no problem so far.

    If I run the client on Unity editor, when it connects to the server, the prefabs that were network instantiated are also synced on this client.

    But if I do a build of the client - Mac or Win - it doesn't sync anymore, even on the same computer. The log file states "Network.Instantiate on the receiving client failed because the asset couldn't be found in the project" and then attempts to run the Profiler, which doesn't run because I'm using the free version.

    And the network manager logs everything correctly, but in the build, the assets aren't found.

    My setup is Snow Leopard with Unity 3.5.3f3 for the editor and the same and winxp for build testing.

    Thanks
     
    Last edited: Jul 19, 2012
  2. joaomesq_old

    joaomesq_old

    Joined:
    Nov 24, 2010
    Posts:
    2
    Hi,

    Figure it out myself and it was somewhat a dumb error. The first parameter of the Network.Instantiate was broadcasting the game object transform instead of the game object itself.

    Doesn't explain why the code was working on the Editor, though.

    But it's fixed on both server and client.

    Thanks.
     
unityunity