Area2D not 'physically' colliding with other nodes

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

This might sound stupid, but is there a way to make Area2D collide ‘physically’ (as in not go through) other nodes (specifically a Kinematic Body2D for now).

I heard that Area2D nodes are the best to make a basic enemy. I am making a very basic top down shooter and I am wondering if I can make the enemies not go through the player and walls( when I add them eventually). The enemies do not instantly kill the player so they have to physically collide with him. I currently don’t have any code in place that would do that. Is it even possible? or should I change the enemy node to a kinematic body or something else?

:bust_in_silhouette: Reply From: levon00

You can have a KinematicBody2D as your main node of the enemy, Area2D as its child. The Area2D’s collider should be a little bigger than the KinematicBody2D’s, so they will inflict damage first, and be able to collide with the walls/player/other enemies.

:bust_in_silhouette: Reply From: Player0330

If you want kinematic body where player can collide but nothing else
see Physics introduction — Godot Engine (3.1) documentation in English
I don not know about area colliding but you can probably use both KinematicBody2D for collision and collision layers with it and area for collision detection

:bust_in_silhouette: Reply From: ka0s420

I would use kinematicBody2d for the enemies. Area2d is more useful as a trigger than a collider imo. I.e it’s good for transmitting on_body_entered signals to your scripts, allowing things like enemy starts to chase the player when in range and stuff like that.