AI laggy movement

I have an AI in my game and whenever he sees me his movement is laggy and he also sometimes thinks he can’t see ma and starts moving randomly again even though I’m directly infront of him. Sometimes when I’m jumping up and down infront of him he also doesn’t see me for like 20 seconds and then he starts following me.