Hi, so i have this script that spawns a prefab whenever player presses "G". Before it worked correctly, now it does it twice. Script: Code (CSharp): [Command(channel = 1)] public void CmdPlaceTrap(int obj) { if (isLocalPlayer) { if (trapsCount != 0) { GameObject go_ = NetworkManager.singleton.spawnPrefabs[obj]; GameObject goIns = (GameObject)Instantiate(go_, cursor.transform.position, this.transform.rotation); NetworkServer.Spawn(goIns); trapsCount--; RpcPlaySfx(goIns); } } } Another script that triggers this action: Code (CSharp): void Update() { if (Input.GetKeyUp(KeyCode.G)) { pc.CmdPlaceTrap(0); } if (Input.GetKeyDown(KeyCode.F)) { Interact(); } } I hope you understand.
I found out the problem. When using "Normal" mode in the inspector, i couldn't see the script. When i turned on the Debug mode i could see that the script was 2 times in the same object. I think that's an unity bug because in normal mode there was only one copy of the script.