How can I use LookAt() function

The code is

PointAndClick.prototype.movePlayerTo = function (worldPosition) {

    this.targetPosition.copy(worldPosition);
    this.distanceTravelled = 0;
    this.direction.sub2(this.targetPosition, 
    this.playerEntity.getPosition());
    this.distanceToTravel = this.direction.length();
    if (this.distanceToTravel > 0) {
        console.log(this.targetPosition);
        this.direction.normalize();
        this.playerEntity.lookAt(this.targetPosition);
    } else {
        this.direction.set(0, 0, 0);
    }
};

It doesn’t work.
Help me

Hi @Anton11,

Did you get that code from the point and click code example?

What isn’t working? Are you getting any errors or you aren’t getting the desired behavior?

For that script to work, you need to make sure that you are using all the methods provided.