- Home /
I have a glitch with my game that makes bullets keep firing when it goes into the next level
Hi I am 13 years old and have been making a game that involves 3 buttons that make 3 different characters shoot. and when you hold a button down it keeps shooting, and if you have it keep shooting when the next level loads in the next level that character will keep shooting even when you un-click
so I either need to know how to make it so the characters don't keep firing when you hold the button down
or I need to know how to make it so it doesn't keep firing into the next level
Here is the button script
#pragma strict
public static var centerAttack: boolean = false;
function On$$anonymous$$ouseDown()
{
centerAttack= true;
}
function On$$anonymous$$ouseUp()
{
centerAttack = false;
}
Here is the winlevel script
#pragma strict
function Start () {
}
function Update ()
{
if(GameObject.Find("LumberjackB") == null && GameObject.Find("LumberjackT") == null)
{
level.level++;
Application.LoadLevel("boarder wars.level2");
}
}
I think you accidentally converted your comment into an answer :P
When you load the next level, are you destroying all of the characters and buttons and reloading them all? Or have you made it so the characters / buttons stay when you load the next level?
@432qwerty No I had to convert it so I could format it, then convert it back. We can't edit comments alone for some reason.
(There's also a strange annoying glitch that prevents the formatting from updating until it's edited a second time. Just thought I'd add that here.)
Your answer
Follow this Question
Related Questions
Creating a level switch by using mouse function in a certain area 1 Answer
How do i set screenshot image of Scene2 to Scene1(Button) in unity. Thanks in adavance 1 Answer
how to make a button work on main menu? 0 Answers
Moving 2D Game Object on GUI Button Click 2 Answers
If you help me, i make you 3d object 1 Answer