my enemy’s y-axis changes constantly. i am using nav mesh agent, as long as i was using character controller. it was fine, but now i needed to use nav mesh agent but my enemy starts to float or fall (passes through) from the plane. i have tried different values for base offset in mesh nav agent but it just slows down the floating/falling process, doesn’t stop it completely.
You may have a Rigidbody (non-kinematic) and a NavMeshAgent on the same GameObject, and both try to control the transform—gravity pulls it down while the agent tries to keep it on the NavMesh surface.
The Unity manual explicitly warns about the Rigidbody + NavMeshAgent race condition and says you must use kinematic when mixing them see docs. The baseOffset tweak only changes how far above the NavMesh surface the agent sits — it doesn’t resolve the physics fight
i did had rigidbody and tried to freeze the y-axis, it didnt worked so i removed it. now i only have nav mesh agent. and it still float/fall. i wonder if nav mesh surface has anything to do with this.
i accidentally put nav mesh surface inside my enemy (parent-child relation). that was my mistake. in case it helps someone else.