I have made a game where you move a ball, collect coins and escape the enemies.
if you collect all 10 coins your scene will change to You Win screen But if you touched any enemy or entered any enemy body your scene will change to Game Over screen.
I want to assign a key on the keyboard (Like Shift + D) which when I press, It Disables the function or code of line in which when the ball enters the enemy body the scene changes to Game Over.
func _on_enemy_body_entered(body):
if body.name == "Ball":
get_tree().change_scene("res://Demo menu screen/Gameover.tscn")
# I want to disable this line of code or function when a key is pressed