Hi guys. I've been trying to make weapon pickup script.And the problem is how to switch GameObject variables. Here's the part of script: Code (csharp): //Weapons in game var First: GameObject; var Second : GameObject; var WeaponIndex : int = 0; function Update () { if(Input.GetAxis("Mouse ScrollWheel")){ curWeapon +=1; } if(curWeapon == 1) { Second.gameObject.SetActiveRecursively(true); First.gameObject.SetActiveRecursively(false); } //Chage part //***** //***** //***** if (WeaponIndex == 1) { //First weapon change to weapon that's in var Num1 First == Num1; } } It doesn't show any errors but i just won't work. How can i get GameObject that's on Num1 be on First variable? Any ideas? Ty -3DK
At a glance I think you want Code (csharp): First = Num1; instead of Code (csharp): First == Num1; for line 32