Hello everytime I press the E key my weapons should switch, but it doesnt happen. My gun is a child of my arms and the baseball is apart of it. I disable my arms when i active my baseball and disable my arms when i activate my baseball.
var Geweer : GameObject;
var Arms: GameObject;
static var HandWapenA = false;
function Update () {
if (Input.GetKeyDown(KeyCode.Q))
{
SwapWeapons1();
}
if (Input.GetKeyDown(KeyCode.E))
{
SwapWeapons2();
}
}
function SwapWeapons1()
{
print(“knuppel”);
this.Arms.SetActive(false);
this.Handwapen.SetActive(true);
HandWapenA = true;
}
function SwapWeapons2()
{
print(“Geweer”);
this.Arms.SetActive(true);
this.Handwapen.SetActive(false);
HandWapenA = false;
}