Move the agent to the player when the player enters into the Nav Mesh Bounds Volume

Hi!

I’m using this code to move an enemy to the player:

It works when the player is inside the Nav Mesh Bounds Volume. But, when the game stars, the player is outside the Nav Mesh Bounds and then enter on it, the enemy doesn’t move to the player.

How can I fix it?

Thank you!

Honestly. you should probably just wrap the whole level in nav mesh bounds so the ai doesn’t glitch out if the player runs out of bounds while being chased.

Either way, if you only want ai to move to player when player enters a certain area, best bet would be to make a large collision volume with trigger collision preset, and on begin overlap, check if overlapped actor is player controlled, and if so, call a function on pawns to wake them up. If you keep the current nav setup where the nav doesn’t cover everything, make the trigger the same size as nav bounds volume.

Even better would be to give enemies a pawn sense component or perception, and only goto player when they actually see you.