How to make an NPC actor ignore collision with the same actor?

Hi,

I’ve been scratching my head for a while now about this but hopefully someone can help me.

i have an enemy character which has multiple children that roam around in the map and in a certain condition i would like for one of these actors to not collide with the other children, to avoid them to be stuck, how can i achieve this effect?

i have tried making a custom collision channel and changed all of the collision channel type on the parent actor but still it did not work and

extra context: the characters come and gather in a restaurant so they will crowd the place and when one of them receive their order i would like them to leave without colliding with other character and get stuck

thank you in advanced

Hey @MadLed!

Are you using the DetourCrowd AI Controller? If so, collision isn’t the problem, they won’t go within each other’s space because of that.

If you’re not: did you set them all to ignore that channel, and restart the engine? Custom profiles require a restart to go into effect!

Hope this helps, let us know how it goes! :slight_smile:

Hi @Mind-Brain

i am using ROV Avoidance and mostly it works when the characters are moving, but when 1 character is standing and another one tries to move and collides with it they get stuck

are you saying of i have detour crowd on and customize the collision channel at the same time it will not work? because i have tried every channel setting and they either fall through the ground or collide with each other

@Mind-Brain

i tried turning off ROV avoidance but still same issue

to test it i made the channel ignore the player character and it does ignore it but only if the enemy character is standing, but if the enemy character is moving then not even the player character can go through them

it seems the issue only arises when the enemy character is moving otherwise it works without an issue

hope this helps you get to a conclusion to this issue

Could I possibly get a picture of your Navmesh with characters on it?

I’m thinking the issue isn’t collision at all- it’s the navmesh being modified by people being on it. That could be enough to block off travel, and if the other ways around are blocked off as well, the traveling will fail and they will stand still.

To do this you can simply drag people in and press “P” on your keyboard while in the viewport, without starting a simulation. It should light up all walkable areas as green.

Okay so they’re not blocking the navmesh.

I notice you have a small box on the front of them, what’s the collision for that? Make sure it’s set to Ignore or Overlap only so it doesn’t block them.

Other than that, yeah it looks like you may have to resort to using the base AI Controller (not detourcrowd) if they’re refusing to pass through each other. Then if there’s STILL a problem maybe you can work towards using detourcrowd again- you can change the parent class of your AI Controller in the top right of the AIC blueprint! Give that a try!

Also- maybe don’t use that new collision channel? You should only need to use Pawn and set them all to ignore Pawns.

the box in front of them is set to overlap only.

regarding to change the parent class of my ai controller, do you mean that i should change it to the enemy character class?

i tried that and now it is throwing me an error

IT WORKED AND I DO NOT KNOW WHY!!!

i switch all of the enemy character components collision channel object type to (Pawn) AND IT WORKED!!!

thank you so much @Mind-Brain but please if you can elaborate on why did this work that woulkd be great :,)

Edit: i found that my player character was set to block the custom channel that i created ._.
but still i do not know why the other enemy characters were blocking each other

Another Edit: tried setting my player character to ignore the custom channel and it still did not work and now im dizzy

Hey Great! Kind of! :joy:

So if leaving them as Pawn works, you don’t need that custom channel and you can remove it.

Then you tell the player to ignore pawns (it should be a pawn itself). Ensure that both any colliders AND your skeletal mesh says so on BOTH your player and your little guys!

Let me know if that doesn’t work, and let’s leave it unsolved until it’s all ironed out! :slight_smile:

Edit: Also I took a look at your picture- You’ll want to rename that to BP_something because AI names generally are just the brain/controller. What you have in the picture is a character :slight_smile:

after tweeking the collision settings i have set both of the player character and the enemy character into pawns and now they work perfectly just how i wanted it

not sure why the custom channel had issues but illl remove it and work with what unreal engine provides!

thank you so much @Mind-Brain for your amazing help! ive been stuck with this issue for a while now XD

1 Like