Implementing Recoil

So I want to make the camera recoil when left click is pressed , everything is right except the problem that if i use this.entity.setLocalEulerAngles to set the Euler angles but it gets overwritten by the first person camera which calls itself per frame , I don’t know how to go about fixing this , any Help is appreciated

Here’s the code

Recoil.prototype.initialize = function() {
    this.lerpedRotation = new pc.Vec3 ();
    this.Lerpspeed = 1;
    this.alpha = 0;
};

// update code called every frame
Recoil.prototype.update = function(dt) {
   this.alpha += this.Lerpspeed * dt;
    this.firstloc = this.entity.getLocalEulerAngles(); 
    this.targetRotation = new pc.Vec3 ( this.firstloc.x+ 10,this.firstloc.y  , this.firstloc.z);
    
   if (this.app.mouse.isPressed(pc.MOUSEBUTTON_LEFT)) {// this.lerpedRotation.lerp (this.entity.getEulerAngles(), this.targetRotation, this.alpha);
    this.lerpedRotation.lerp (this.entity.getLocalEulerAngles(), this.targetRotation, this.alpha);  // this.finalRot.lerp(this.lerpedRotation, this.firstloc1, this.speed * dt)  ;
    // Update the entity's Rotation to the lerped position
    this.entity.setLocalEulerAngles (this.lerpedRotation);
   }  

I would move the code to the first person camera. Assuming you want different recoil patterns with different weapons, you can pass a function to the camera based on the weapon that stores the recoil pattern/behaviour.

I understand , thank you