how do i implement contact damage?

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

I’ve been looking around for a few hours now trying to figure out how to implement this feature, I’ve tried sending a signal whenever the enemy and the player come into contact but I couldn’t get that to work. I’m new to Godot and have no clue what to do.

Also the game is a 2D Platformer

:bust_in_silhouette: Reply From: exuin

You should stick an Area2D on the player. The docs contain more info - but the basic idea is that an Area2D can detect other physics bodies. You’ll want to connect signals from the Area2D and apply damage in those functions.