short note: English isnt my primary language and i suck at it i will try my best to explain my problem.
Now i made this script :
var Shotgun : GameObject;
var Sniper : GameObject;
function start ()
{
Shotgun.SetActive(true);
Sniper.SetActive(false);
}
function Update ()
{
if(Input.GetKeyDown("1"))
{
Shotgun.SetActive(true);
Sniper.SetActive(false);
}
if(Input.GetKeyDown("2"))
{
Shotgun.SetActive(false);
Sniper.SetActive(true);
}
}
Alright, Script is working fine, it does select shotgun on pressing 1 and sniper on pressing 2. but problem is that whenever i start the game i get both guns working at a time, then if i press 1 or 2 then it selects particular gun, but at starting time i get both guns active…
question is how i can improve script that, when i start game, only shotgun’s active, but when i press 2 then i get sniper…?
i am pretty “Noob” in scripting :(.
Please help!