How Can I have lerp () for better smooth transition when changing position along with rotation of player.
if (x !== 0 || z !== 0) {
worldDirection.add(tempDirection.copy(forward).mulScalar(z));
worldDirection.add(tempDirection.copy(right).mulScalar(x));
worldDirection.normalize();
var pos = new pc.Vec3(worldDirection.x * dt, 0, worldDirection.z * dt);
pos.normalize().scale(this.speed);
pos.add(this.entity.getPosition());
var targetY = this.cameraScript.eulers.x + 180;
var rot = new pc.Vec3(0, targetY, 0);
this.entity.rigidbody.teleport(pos,rot);
}