#(Resolved) How to get enemies to stop clumping together.
26 messages · Page 1 of 1 (latest)
One way would be to give them collision boxes to keep spaces between them. This is probably the simplest way.
Learn to make an Action RPG in Godot Engine 3.2. Godot is a wonderful free and open source game engine designed for indies. It is powerful and flexible.
This video was made possible by my wonderful Kickstarter backers.
If you are interested in taking a deeper dive into the Godot game engine you can buy my 1-bit Godot Course at this link: http...
This tutorial covers a different way you could deal with clumping.
give them collision boxes and makee sure the collisionbox layeer and mask match so that they can notice each other. It would probably help if the enemies are characterbody2d (at which point a collisionbox is reequired)
the vampire survivor tutorial should actually cover this problem of them clumping together
How do I check if they the collision box layer and mask match?
nvm, you need to handle collision in the characterbody2d node. There, in the inspector go to "collision", and make sure that they are on a layer and that the mask also covers that layer. Didn't the vampire survivor tutorial also cover this? I thought it did
The layer and mask are the same.
They still collide though.
Nvm, they are on a different layer. The tutorial said to do that though?
depends on what you ant to achieve. If you put them on a different layer, you can target them specifically or you can make it so that they can't interact (example, if you want flying opponents to not collide with ground-moving opponents, you could make layer 2 be opponents and layer 3 be flying opponents, and then adjust the masking so that both mask layer 1 with the player, but only "normal" opponents mask layer 2 to collide with other "grounded" opponents, while flying opponents mask layer 3 but not 2 so they collide with each other and the player, but not the "ground" opponents
I only have ground opponents
So basically:
Layers - I'm here
Mask - I can see (and collide with) you
they need to see each other to know they're here
that's why they need to be the same
I'll play around with it and see what works.
iirc, in the tutorial you move opponents to layer 2 so that the bullet doesn't collide with the player (so that the bullet can only mask the enemy layer and doesn't need to mask the player layer)
I changed the enemy to be on the same level, now the auto-aim is broken.
uh, iirc it's supposed to be something like this:
Player layer: 1
Player mask: 1, 2
Opponent layer: 2
Opponent mask: 1, 2
Bullet layer: none
Bullet mask: 2
If it's like this, it should work: Both the player and the opponents can see each other, but the bullet can only see enemies
Thank you so much!
I realized that my main issue was I mistook collision and visibility. I had visibility open so I was changing the mask and layer there, not on the collision tab.
Is there a way to "resolve" the issue, or do I just leave it like this?
ye, you can change the title of the post and put (resolved) in front
alright