Make an object point towards an object

Ok so i previously posted about making a working projectile, and now im working on an enemy, but theres one problem. I need to enemy to point towards the character. I have tried this before, and also tried using it to make the gun point to the mouse, but the method in this video did not work https://www.youtube.com/watch?v=dXMV1uxjHRU&t=9s

the game:game4-5-2021_12-05-22.wick (11.9 KB)

This function should help:

this.pointTowards=function(Obj){
this.rotation = -Math.atan2(this.x - Obj.x, this.y - Obj.y) * 180 / Math.PI;
}

game4-5-2021_12-38-49.wick (12.0 KB)

Thanks again, i looked so hard but didnt seem like many people were having the same problem