Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

Network.Instantiate c# issues

$
0
0
I rewrote my network manager script from Javascript to C#, and I ran into a problem. After a lot of debugging it seems the scripts still function same, except that the lines Instantiating my players, cameras, and game controller game objects no longer do anything. Seemed like an easy fix to me, but after a bunch of research on the problem I'm still pretty lost. I've looked [here][1], [here][2], [here][3], and [here][4]; I think some of these cases are the same problem I'm having, but I just don't understand the solution. Here's one of my instantiate lines: GameObject player = Network.Instantiate(playerPrefab,spawn.position,Quaternion.identity,0) as GameObject; Is there something I'm missing as part of the c# syntax? Again, the same script in Javascript functions as expected without any problems with the instantiate. Another very strange point is that in fact the c# script ***DOES*** instantiate my game objects when I run the game in the editor, but *not* when I build it. The build fails regardless of whether it is the client or server. [1]: http://forum.unity3d.com/threads/6661-Network-Instantiate-not-working-as-described [2]: http://docs.unity3d.com/Documentation/Components/net-NetworkInstantiate.html [3]: http://forum.unity3d.com/threads/144067-Network-instantiate-doesn-t-find-assets-on-build [4]: http://forum.unity3d.com/threads/50632-Network-Instantiate-Asset-couldn-t-be-found

Viewing all articles
Browse latest Browse all 171066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>