- Home /
NavMeshAgent and CharacterController.isGrounded
Ok, I need to have an enemy that pathfinds to the player. But at some points I also need to check if the enemy is grounded, and move it around manually, so I attached CharacterController to it as well. The problem is that CharacterController.isGrounded always returns false, because my NavMeshAgent floats slightly above the ground (so low you can't see it unless you get gizmos on and camera just right). But still, that prevents CharacterController from being grounded. I tryed messing up with NavMeshAgent properties, and no matter how I set them up it still floats. I tryed extending CharacterController so it would stick below NavMeshAgent, but I couldn't get it to work whatever I do. Now what I of course COULD do is draw a ray or something pointing down and detect the ground that way, but I would like to try and make CharacterController work. Any tips, or suggestions?
Thanks in advance for help.