# A question about RotateAroundDistance

**URL:** <https://phaser.discourse.group/t/a-question-about-rotatearounddistance/4347>\
**Category:** Phaser 3\
**Created:** [November 22, 2019, 9:22pm UTC](https://phaser.discourse.group/t/a-question-about-rotatearounddistance/4347 "2019-11-22T21:22:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![BlunT76](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/blunt76/32/1454_2.png) [@BlunT76](https://phaser.discourse.group/u/BlunT76)\
**Post date:** [November 22, 2019, 9:22pm UTC](https://phaser.discourse.group/t/a-question-about-rotatearounddistance/4347/1 "2019-11-22T21:22:27Z")

</div>

Hi,  
I try to reproduce this example:  
[https://labs.phaser.io/edit.html?src=src/actions/rotate%20around%20distance.js&v=3.21.0](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?

---

<div class="post-metadata">

**Author:** ![digitsensitive](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/digitsensitive/32/349_2.png) [@digitsensitive](https://phaser.discourse.group/u/digitsensitive)\
**Post date:** [November 23, 2019, 11:48am UTC](https://phaser.discourse.group/t/a-question-about-rotatearounddistance/4347/2 "2019-11-23T11:48:11Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![BlunT76](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/blunt76/32/1454_2.png) [@BlunT76](https://phaser.discourse.group/u/BlunT76)\
**Post date:** [November 23, 2019, 11:58am UTC](https://phaser.discourse.group/t/a-question-about-rotatearounddistance/4347/3 "2019-11-23T11:58:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [November 23, 2019, 6:33pm UTC](https://phaser.discourse.group/t/a-question-about-rotatearounddistance/4347/4 "2019-11-23T18:33:09Z")

</div>

That’s just how the function works.

You probably want something like [PlaceOnCircle()](https://photonstorm.github.io/phaser3-docs/Phaser.Actions.html#.PlaceOnCircle) instead.

---

<div class="post-metadata">

**Author:** ![BlunT76](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/blunt76/32/1454_2.png) [@BlunT76](https://phaser.discourse.group/u/BlunT76)\
**Post date:** [November 24, 2019, 1:46pm UTC](https://phaser.discourse.group/t/a-question-about-rotatearounddistance/4347/5 "2019-11-24T13:46:15Z")

</div>

Thanks samme, i’ll give it a try.
