I made a point in direction script but is not working. The code is here:
EnemyLookAt.attributes.add('Player', {type : 'entity'});
// initialize code called once per entity
EnemyLookAt.prototype.initialize = function() {
};
// update code called every frame
EnemyLookAt.prototype.update = function(dt) {
this.entity.lookAt( EnemyLookAt.getPosition(Player) );
};
// swap method called for script hot-reloading
// inherit your script state here
// EnemyLookAt.prototype.swap = function(old) { };
// to learn more about script anatomy, please read:
// https://developer.playcanvas.com/en/user-manual/scripting/