Godot Version
4.3
Question
So I have a “spike” StaticBody2D that I want to damage the player when it collides with it. I was wondering what is the best way to go about doing this?
I was thinking of maybe having a separate Area2D around the player which when colliding with a spike triggers damage for the player, but this seemed like it could be inefficient.
(Google translator)
I’m not an expert, but ideally your player should have their movement collisions separated from their hitboxes (the former are usually more generous than the latter to help the player).
If you have well-defined masks and collision layers for each object, it doesn’t have to be inefficient.
There are some very good videos on YouTube about how to model with hit and hurtboxes.
3 Likes