Quantcast
Channel: Multiplayer
Viewing all articles
Browse latest Browse all 16796

Instantiate only creates on the Host

$
0
0
I'm trying to learn how to make an online game using Unity so i'm pretty noob at this.
I'm trying to create an object in run-time, so when I press space bar, a function is called. here are the codes for that function:

Code (CSharp):
  1. [Command]
  2.     void CmdDoFire(){
  3.         GameObject o = Instantiate (Resources.Load ("Car2")) as GameObject;
  4.         o.transform.position = transform.position;
  5.  
  6.         NetworkServer.Spawn (o);
  7.     }
The problem with this is that it only creates the object...

Instantiate only creates on the Host

Viewing all articles
Browse latest Browse all 16796

Trending Articles



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