Your code is fine. At least, I cannot spot any problem. From what I understood, your enemy moves with base offset set to 5. If that’s correct, your code obviously works.
In answer 15 in this thread, you shared a screenshot. The enemy looks as if its bottom part is stuck in the navmesh.
My Enemy starts to float over the ground and is still static.
What do you mean by static? In Unity, ‘static’ usually refers to the Rigidbody or the ‘Static’ setting in the Inspector. A moving collider must not be set to ‘static’.
Have you already tried to add Debug.Logs to your code to see what is going on during runtime? For example, does the Update method get called? If so, does the first if-block get called, and does isDetected
get set to true?
The enemy chases or attacks the player only if EngageTarget();
gets executed.
Also try to reassign the Target by dragging and dropping the ‘player’ from your Hierarchy onto the Target field of the EnemyAI component.