Hi,
I am making a top down shooter and i can’t seem to make the power up collection work properly.
I have a power up falling from the top of the screen and when the player collects it, their shooting power goes from a single shot to a double shot.
The things that work are the power up moving down the screen and it can be collected, but the double shot never happens it stays as a single shot.
function SecondShot ()
{
if (gameObject.tag == "double shot")
{
//Create a second bullet.
if(Input.GetKeyDown(fireKeyInput))
{
Instantiate (projectile, socketProjectile2.position, socketProjectile2.rotation);
audio.Play();
}
}
}
I placed SecondShot (); inside the function update () and play the game, i can shoot the single shot and collect the power up for the double shot, but the double shot does not work.
if i place // in front of if (gameObject.tag == “double shot”) as well as the two { } it is contained in and then run the game i have the double shot from the start and still can collect the double shot power up.
can anyone shed some light on where it is i am going wrong?
Thanks in advance.
Chobi.