Topic was automatically imported from the old Question2Answer platform.
Asked By
gerep
Hi,
I’m working on a top-down shooter.
The mobs are KinematicBody2D objects that I am spawning. It is not a problem if I have to change the type.
They are following the player and eventually they will get on top of each other.
I want to avoid it. Looking around I found examples I can use to make them bounce but that’s not what I want, I don’t want them to take the same space.
Well as long as you have collision shapes on your enemies and you make sure those collision shapes are looking at the same layer the enemy is on then they will bump into each other rather than go on top of each other.
Thank’s what I was expecting but I am missing something I can’t find.
You see that the Mob (kinematicbody2d) has the collision layer and mask set to 1 (default).
The Area2D I am using to detect when a bullet hits it.
The CollisionShape2D is also using the default configuration.
In the Level scene I am spawning the mob like this: