collide two collision sprite

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

how can i collide two collision sprite?i mean when collide two sprite ,then 1 sprite will be invisible or dead…how can do it?

:bust_in_silhouette: Reply From: Ertain

Collision nodes don’t work without some kind of node to make use of the collision data. For example, Area2D has the signal area_entered(area), which can be utilized to detect other collision objects. Use area_entered() to detect the other sprite. When the collision occurs, have one of the sprites become invisible.

This is just with the Area2D node. There are the 'body nodes (e.g. KinematicBody2D) which respond to collisions differently. Look at the official documentation for more information: