Godot Version
4.3
Question
Hi !
On a collision of player, I’d like to show a “GAME OVER” sprite on the screen.
Therefore, I have made a Sprite2D called “GameOver”, and removed the “visible” option in the inspector.
Then, on player script, I have this :
func _physics_process(delta):
(…)
var collision = move_and_collide(velocity*delta)
if collision:
if collision.get_collider().name == “Ennemy”:
print(“GAME OVER”)
$GameOver.visible = true
I get the “GAMEOVER” in the console but i get "invalid assignement of property or key ‘visible’ with value of type ‘bool’ on a base object of type ‘null instance’
it means it doesn’t find $GameOver ?
Any hint to show the sprite2D ?
Thanks