public void BroadcastHit(string shooterId) { if (Random.value <= UserDefinedConstants.chanceForSunToGivePowerup) { // Choose a random direction in which to drop the powerup Vector3 direction = Random.onUnitSphere; int powerupIdx = powerupCtrl.RandomPowerupIdx(); string powerupId = Tools.GenerateRandomString(16); photonView.RPC("HitAndPowerup", RpcTarget.Others, shooterId, direction, powerupIdx, powerupId); HitAndPowerup(shooterId, direction, powerupIdx, powerupId); // Do this locally so player gets quick feedback } else { string targetUserId = PhotonNetwork.PlayerList[(new System.Random()).Next(0, PhotonNetwork.PlayerList.Length)].UserId; photonView.RPC("HitAndTarget", RpcTarget.Others, shooterId, targetUserId); HitAndTarget(shooterId, targetUserId); // Do this locally so player gets quick feedback // TODO: Should the sunray really be fired locally...? } }