Making a sprite detect collision from a player (2D)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By R3prisal

Hi, I am really new to using Godot and I can’t find any tutorials for Godot 4.0 on creating some sort of sprite that can detect the collision with the player and then quit the game or print an output that informs me the player touched the sprite.

(Basically a explanation on how to make a sprite end the game when a 2D character touches it.)

:bust_in_silhouette: Reply From: Moreus

sprite don’t have collisions, you needed add collision-shape node and body(depends of type of object).