# Physics can't move children obj

**URL:** <https://phaser.discourse.group/t/physics-cant-move-children-obj/4757>\
**Category:** Phaser 3\
**Created:** [January 2, 2020, 8:49pm UTC](https://phaser.discourse.group/t/physics-cant-move-children-obj/4757 "2020-01-02T20:49:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![William\_Soeparjo](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/william_soeparjo/32/1406_2.png) [@William\_Soeparjo](https://phaser.discourse.group/u/William_Soeparjo)\
**Post date:** [January 2, 2020, 8:49pm UTC](https://phaser.discourse.group/t/physics-cant-move-children-obj/4757/1 "2020-01-02T20:49:17Z")

</div>

Here is the code

```
let enemys = this.physics.add.group();

	for(let i=0; i<5; i++){
		let x = Math.round(Math.random()*(1000)+100);
		let y = Math.round(Math.random()*(600)+100);
		let o = this.physics.add.image(x,y,'b');
		o.setDamping(true);
    	o.setDrag(0.99);
    	o.setMaxVelocity(80);
    	o.timer = 3;
    	o.setCollideWorldBounds();
    	random_move(o);
    	enemys.add(o);
	}

```

I can’t move /accelerate object (random\_move) on created and i can’t setCollideWorldBounds(), unless i waited a second to do it.

Btw it’s working fine when i create un-grouped object.

How to fix this?

Thanks

---

<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:** [January 2, 2020, 10:09pm UTC](https://phaser.discourse.group/t/physics-cant-move-children-obj/4757/2 "2020-01-02T22:09:30Z")

</div>

Physics groups apply [defaults](https://photonstorm.github.io/phaser3-docs/Phaser.Physics.Arcade.Group.html#defaults) when adding or creating members.

It will work if you add/create first and then modify after:

```javascript
for (let i = 0; i < 5; i++) {
  let x = Math.round(Math.random() * (1000) + 100);
  let y = Math.round(Math.random() * (600) + 100);
  let o = enemys.create(x, y, 'b');
  o.setDamping(true);
  o.setDrag(0.99);
  o.setMaxVelocity(80);
  o.timer = 3;
  o.setCollideWorldBounds();
  random_move(o);
}

```

---

<div class="post-metadata">

**Author:** ![William\_Soeparjo](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/william_soeparjo/32/1406_2.png) [@William\_Soeparjo](https://phaser.discourse.group/u/William_Soeparjo)\
**Post date:** [January 3, 2020, 11:26am UTC](https://phaser.discourse.group/t/physics-cant-move-children-obj/4757/3 "2020-01-03T11:26:30Z")

</div>

Thank you!

It’s working when i add group after create a physics object
