I have trouble with AI agent character seeking target. I tried to reproduce it with this simple scene:
But the problem is that if I added another platform (same as the first one, nav static and walkable) to the scene, baked NavMesh again and played the scene, the capsule moved straight out of the platform and didn't stop at the edge. If the capsule is selected, we can see that a cylinder frame (representing the NavMesh agent?) stoped at the edge.
In my game the capsule is an enemy, the green ball is the player, the big grey plane is water or something, and only the player can move on it, the orange platforms are ground that the enemy may patrol on them. If the player is seen by the enemy, the enemy starts moving towards the player. But if the player jumps into the water, the enemy stops by the water. The game doesn't matter. I just want to explain why I'm creating a scene like this.
So any advice? Thanks!
- capsule: UCC generic character, Third Person Movement, with Behavior Tree and Nav Mesh Agent.
- green ball: target Game Object
- orange platform: navigation static game object, walkable, no OffMeshLink
- big white plane: navigation static Game Object, not walkable
But the problem is that if I added another platform (same as the first one, nav static and walkable) to the scene, baked NavMesh again and played the scene, the capsule moved straight out of the platform and didn't stop at the edge. If the capsule is selected, we can see that a cylinder frame (representing the NavMesh agent?) stoped at the edge.
In my game the capsule is an enemy, the green ball is the player, the big grey plane is water or something, and only the player can move on it, the orange platforms are ground that the enemy may patrol on them. If the player is seen by the enemy, the enemy starts moving towards the player. But if the player jumps into the water, the enemy stops by the water. The game doesn't matter. I just want to explain why I'm creating a scene like this.
So any advice? Thanks!