Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Update() {
- if(!isLocalPlayer) return;
- if(Input.GetKeyDown(KeyCode.Space)) CmdSpawnCrap();
- }
- [Command]
- void CmdSpawnCrap() {
- GameObject cube = Instantiate(objectToSpawn, spawnPoint);
- NetworkServer.Spawn(cube);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement