How to interrupt a cam.pan execution?

I let the user to pan manually but if they tried to do it during the progress of an auto panning invoked with cam.pan occurs a race condition, I guess. I want to interrupt the auto panning when this happen to let the user control the scroll position.

pan takes an extra parameter that let’s you ‘force’ it to happen regardless of if another one would be interrupted.

const force = true;
this.cameras.main.pan(x, y, dt, "Circ", force);

Thanks, I looked in the documentation again and found that Cam has panEffect member which in turn has reset method to achieve this, so now I’m using something like:

this.cameras.main.panEffect.reset();
1 Like