Can I have an object affect AI navigation only?

Hi!
I’m wondering if an object (specifically a cube in a blueprint) can affect nothing but navigation. Its not supposed to be visible, it should not interfere with any sort of collision whatsoever. The only thing I want it to do is to tell AI that its blocking their path. I would prefer if I could turn this on or off during playtime too. My navmesh is dynamic.

I’ve tried to set the cube to No Collision, but keep the Can Ever Effect Navigation on, but it still doesn’t work.

Maybe Collision is required for it to affect navigation, and you can get around this problem by creating a new Collision Channel that none of your important objects use, except for the ones used for navigation queries. I don’t know if this will work, but I have an idea where you could use a special Pawn which its own Collision Channel that matches this navigation question and doesn’t really do anything else and all your other pawns could ask it whether it can reach the place they’re trying to go to

Hm, I guess I’ll have to look into collision channels then. Not too sure how they work.

I dont k ow if thats the right way to go but I had the idea because by setting collision channels
I was able to make a wall or force field in my game which allows projectiles to go through but not player characters. I am thinking maybe the navigation system checks ahead to see if the pawn will experience a blocking collision and if it would then it counts as unnavigable territory.
So. I thought maybe collision channels could be used to say this blocks the own but that doesn’t.

But I am not sure how to trick the pawn into thinking it can pass through an object while navigating if he can’t actually pass through it once he encounters it.

Place a “Nav Modifier Volume”. Under Default rollout set Area Class to Null. This should do the trick :slight_smile:
You can do more with it, like make the area more expensive to navigate or only certain AI pawns can go trough it and etc.

Alright, thanks for the help anyway!

Thanks for the answer, I’ll check it out when I got time!

Do this instead of what I said!

Hm, I’m struggling to make it work practically. The thing is, I have these doors that can either be opened by AI or not. If they can be opened by AI, there’s not supposed to be anything blocking the nav mesh in the door. But, if the door is set to only be opened by the player, the nav mesh should be blocked whenever the door is closed, and not be blocked when its already open. But the engine seems to have some trouble with the nav modifier, since some doors don’t affect the nav mesh at all, even though its all based on the same blueprint. Kinda strange. I’m currently trying to work with Nav Link Proxies, but they’re pretty buggy.

You mentioned that your NavMesh is dynamic, so this should be easy. Place NavModifier component inside your Door_BP. This component have access to function called Set Area Class.
Whenever you door opens set New Area Class to None and when closed to NavArea_Null.

Turned out to be a bit more complicated because of the system I’ve created. But I came up with another solution, so it’s all working as it should!

I’m a little curios why this solution could not integrate into your system :slight_smile:
I think whenever and wherever you fire OpenDoor event it’s possible to hook Area Class change.

Also, even if this answer didn’t help your particular case, I believe it would be correct one for other people.

I’ll try to explain :slight_smile:
So, the nav mesh was not controlled by the door blueprint, but rather the button blueprint that control the door. The reason I had to do this was because of some settings in the button blueprint that change how the nav mesh is supposed to act.

At Begin Play I would move the nav modifyer to a specified location (defined with a widget), because there’s several doors in the level, and all are placed different relatively to the buttons that control them.

The first problem was that the nav modifier wouldn’t work a lot of the time, even though the settings were identical to another working button. It would either not be moved to the desired location, or it wouldn’t exist at all. I used the Show Navigation command during play, and there was nothing blocking anything there except for a single actor. Still don’t know how this happened. So it’s true that you are right in most cases, but not this.

The solution I’m using now is kind of a work around, but it works and I’m just relieved to be done with it. It’s very stable too. Only downside is that I have to control the nav mesh with two booleans, one in the door blueprint and one in the button blueprint, but thats how it has to be.