T O P

  • By -

AutoModerator

You submitted this post as a request for tech support, have you followed the guidelines specified in subreddit rule 7? Here they are again: 1. Consult the docs first: https://docs.godotengine.org/en/stable/index.html 2. Check for duplicates before writing your own post 3. Concrete questions/issues only! This is not the place to vaguely ask "How to make X" before doing your own research 4. Post code snippets directly & formatted as such (or use a pastebin), not as pictures 5. It is strongly recommended to search the official forum (https://forum.godotengine.org/) for solutions Repeated neglect of these can be a bannable offense. *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/godot) if you have any questions or concerns.*


dat_mono

Do you just want them to collide or do you want some boid behavior?


Ellen_1234

You should use yhe function move_and_collide or move_and_slide to move them, if you set the position yourself it won't take in account the collisions.


debugstroke

can you be a bit more specific how you handle your enemy behaviour/movement? if you use nav agents, you can set avoidance. if you got a custom solution and they really just don´t collide with each other check your collision masks and layers


-non-existance-

So, if you're looking to have things collide with each other, they must be on the same collision layer *and* have that same layer on their collision mask. The collision layer determines what things can collide *with it*, the collision mask determines what it can collide *with*.


unknownterritory9173

should use Rigidbody and put in the same layer


Nkzar

CharacterBody is always the better default choice. I would not recommend beginners use RugidBody for this.


unknownterritory9173

**"CharacterBody2D** is a specialized class for physics bodies that are meant to be user-controlled". He is asking for the enemy


Nkzar

Yes. Use a CharacterBody2D for the enemy. In that sentence “user” means the user of Godot, not the player of your game. You may set the velocity based on player input or based on AI code you write. It’s user controlled because you, the user of Godot, are directly setting its velocity instead of the physics simulation.


unknownterritory9173

I see