I am using the top-down template, and I’m having some problems with the way the AI is trying to navigate around other characters. Here’s what I’ve tried so far, and it hasn’t worked. I can’t be the first person to have player and enemy characters moving around in the top-down template, so clearly I’m doing something wrong and hopefully someone can help me.
When I press play, and I click to tell the player character to move, it does just find moving around stationary obstacles, such as the blocks in the top-down template. But when I place an enemy character in the world and click to have the player character move to the other side of the enemy, then the player character tries to run through the enemy, fails, and just keeps bumping into the enemy. So, the pathfinding is clearly not taking into account the presence of the enemy character.
To solve this, I have tried checking various combinations of “can ever affect nav” in the enemy’s root, collision capsule, and static mesh component. Some of those have no effect at all. Others will cause the player character to go around the enemy character as we would hope. Sounds like the solution is just to pick the latter, right?
Wrong. The problem is that when I do that, and then I give the enemy character the ability to move around with a behavior tree, the player character does not realize that the enemy character has moved. So, the player character still avoids the enemy character’s original position, but bumps into the enemy character repeatedly at its new position.
Poking around online, I discovered that maybe the solution has to do with having the nav mesh generate dynamically during runtime. Sounds wonderful. So, under project settings, nav mesh, runtime generation, I switched it to dynamic rather than static. But now both the enemy and player characters shake bizarrely when moving around.
I just want the player and enemy characters to be able to move around and not bump into each other all the time. Any suggestions?