I have two if statements inside each other, however when the first if statement becomes false the other if statement still runs, but it only runs once. It is very wierd. I am currently making a flappy bird kind of game
void Update()
{
if(!passed){
if(Player.position.x >= gameObject.GetComponent<Transform>().position.x){
Debug.Log("done");
passed = true;
}
}
}
as you can see when it first starts the passed boolean turns true which means it shouldn’t run again however when I pass the obstacle for the first time it prints out “done” twice. This only occurs for the first obstacle.