Collision point of Hitbox/Hurtbox

Godot Version

4.3

Question

So i have a Hitbox and a Hurtbox both are Area2D’s. I want to spawn an effect at the “exact” point of collision. However you can’t get the exact point of collision on Area2D’s?

I don’t want to spawn the impact effect at the global position of the 2 Areas because it will be very inaccurate with large hurt/hitboxes.

it’s a bit convoluted, but this should put you on the track
https://www.reddit.com/r/godot/comments/emnpwk/is_there_a_way_to_get_the_collision_position_from/

Thanks definitely a bit complex.
So for Anonzs first example should i connect the body_shape_entered signal to the function:
“func _on_Area2D_body_shape_entered(body_id, body, body_shape, area_shape)”?

EDIT:
So is that function only for bodies? I’m using areas. I have connected the signal to the function and it doesnt print anything so it doesnt seem to get called. So doesnt seem to work for Areas

I was able to figure out another way to do it.
I attached a ShapeCast2D to the projectile then i let the Hitboxcomponent just spawn the effect on the collision point of the ShapeCast2D. Can be done with Raycast2D but depending on your projectile shape you might need to use multiple Raycasts. ShapeCast2D works better because you can match the actual shape of the projectile.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.