yet here i am im trying to make this function

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

into an smoother lookat anny one got an idea? how to that in playcanvas

yet here i am im trying to make this function

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

into an smoother lookat anny one got an idea? how to that in playcanvas

Hi @Timme_Kingma,

You can use either a tween or the pc.Vec3 lerp method to animate the look at target point.

There is a number of helpful posts around if you use the forum search method. Here is one:

yeah i made my own vector3 lerp here is code

```
public static LerpVectors(a:Vec3,b:Vec3,speed:number){
let abx =math.lerp(a.x,b.x,speed);
let aby =math.lerp(a.y,b.y,speed);
let abz =math.lerp(a.z,b.z,speed);
return new Vec3(abx,aby,abz);
}
```

```
var currentPosition = this.entity.getPosition();
var point = this._target.getPosition();
var smoothLookAt = intern.LerpVectors(currentPosition, point,this._smoothAmount);
this.entity.lookAt(smoothLookAt);
```

2 Likes

Thanks for sharing!