A question about RotateAroundDistance

Hi,
I try to reproduce this example:
https://labs.phaser.io/edit.html?src=src/actions/rotate%20around%20distance.js&v=3.21.0
but with a moving center, like in the commented line in update.
But i don’t get it to work
Any advice?

I dont see the commented line in update, but what you can do is declare a variable with a initial position and then change that variable in the update function. Something like this:

let posX = posY = 0;

update() {
    Phaser.Actions.RotateAroundDistance(group.getChildren(), { x: posX, y: posY }, 0.04, 200);
    posX += 1;
    posY += 1;
}

Was this what you meant?

Thanks for reply
This is the commented line:

Phaser.Actions.RotateAroundDistance(group.getChildren(), { x: pointer.x, y: pointer.y }, 0.02, 200);

That’s what i did, but if the center is moving, the childrens ends to be all in same position, so i give up and just stop the center from moving while childrens move around.

That’s just how the function works.

You probably want something like PlaceOnCircle() instead.

Thanks samme, i’ll give it a try.