I Need Help Programming A.I For A Game I'm Working On

Yes thats fine, but you have to update your script with the script above again.

oh sorry i did not notice the change…

I see everything is working now except the lookAt function.
I think this is not working with a dynamic rigidbody.
Maybe try to set the rigidbody of the neightbor on kinametic.

I see you change it back to:

this.entity.lookAt(result.entity);

try also this again:

this.entity.lookAt(result.entity.getPosition());

You can also see the console, by clicking on the dots in the top right corner of your browser, and look for More Tools. Then click on Developer Tools.