Timer delays are holding up the code for me

Hi all, I’m trying to set a timer delay for the below method called in the create() of my scene.

The goal is to get a camera to pan to an object called follow until it is close enough, and then use the startFollow. But if the object moves, then I would call the function again. But when I use this.camTimer below, it causes this.camera.pan to not work, seems the game doesn’t finsih loading. And since the distance doesn’t close, it will keep recursively calling the function until it says maxium stack exceeded.

What am I doing wrong?

cameraPan(follow, speed) {

        if (!speed) speed = 1;

        let distance = Phaser.Math.Distance.Between(follow.x,follow.y,this.camera.scrollX,this.camera.scrollY);


        let duration = (speed / distance) * 1000000;

        if (distance>30) {

            this.camera.pan(follow.x, follow.y,duration)

            if (this.camTimer) this.camTimer.removeEvent();

            this.camTimer = this.time.addEvent({

               delay: duration,

                callback: this.cameraPan(follow, speed), //THIS STOPS THE GAME

            });

            console.log('restart');

        } else {

            this.camera.startFollow(follow);

            if (this.camTimer) this.camTimer.removeEvent();

            console.log('done');

        }
}

I think it should be

callback: () => { this.cameraPan(follow, speed) },

Also it looks like duration should be

let duration = (distance / speed) * CONSTANT;

Thank you! works great!