Question by
shinichi gant · Oct 22, 2015 at 09:23 AM ·
characterphotonchangeonline gamearms
Hi. I have a problem with the change weapon online. I do not know how to fix this script for switch weapons online... if (m_PhotonView.isMine == true)
pragma strict
var Weapon01 : GameObject; var Weapon02 : GameObject;
function Update () { if (Input.GetKeyDown(KeyCode.Q)) { SwapWeapons(); } }
function SwapWeapons() {
if (Weapon01.active == true)
{
Weapon01.SetActiveRecursively(false);
Weapon02.SetActiveRecursively(true);
}
else
{
Weapon01.SetActiveRecursively(true);
Weapon02.SetActiveRecursively(false);
}
}
Comment