Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. void Update() {
  2. if(!isLocalPlayer) return;
  3. if(Input.GetKeyDown(KeyCode.Space)) CmdSpawnCrap();
  4. }
  5.  
  6. [Command]
  7. void CmdSpawnCrap() {
  8. GameObject cube = Instantiate(objectToSpawn, spawnPoint);
  9. NetworkServer.Spawn(cube);
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement