void SpawnMouse() { Debug.Log("spawn mouse"); SpawnM mys = sm[Random.Range(0, 2)]; GameObject myMouse = (GameObject)PhotonNetwork.Instantiate("Mouse", mys.transform.position, mys.transform.rotation, 0, null); myMouse.GetComponent <MouseMovement>().enabled = true; myMouse.transform.FindChild("MouseCam").gameObject.SetActive(true); //myMouse.GetComponent<NetworkPlayer>().enabled = false; //enables minimap: myMouse.GetComponent <Minimap>().enabled = true; }
IEnumerator respawn() { yield return(new WaitForSeconds(spawnDelay)); //spawns at random mouse spawn location SpawnM mys = sm[Random.Range(0, 2)]; transform.position = mys.transform.position; transform.rotation = mys.transform.rotation; //enable movement and cam movement again alive = true; currentHealth = maxHealth; GetComponent <MouseMovement>().enabled = true; CamMovement cam = gameObject.GetComponentInChildren <CamMovement>(); cam.enabled = true; transform.GetComponent <PhotonView>().RPC("PlayAnim", PhotonTargets.All, "Unarmed-Idle"); }