# Phycis.group vs physic.staticGroup issues

**URL:** <https://phaser.discourse.group/t/phycis-group-vs-physic-staticgroup-issues/5796>\
**Category:** Phaser 3\
**Created:** [April 6, 2020, 1:37pm UTC](https://phaser.discourse.group/t/phycis-group-vs-physic-staticgroup-issues/5796 "2020-04-06T13:37:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nik0w](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/nik0w/32/692_2.png) [@Nik0w](https://phaser.discourse.group/u/Nik0w)\
**Post date:** [April 6, 2020, 1:37pm UTC](https://phaser.discourse.group/t/phycis-group-vs-physic-staticgroup-issues/5796/1 "2020-04-06T13:37:35Z")

</div>

Hi !

I’m trying to create a simple platformer, i’ve added some platforms to a physics group, it’s work but when the player is on a platform, it’s not triggered like the floor and i can’t jump from it.

Otherwise, i tried to do it with static group, it’w work perfectly, but my platforms have tween, and width static group, the body doesn’t move… (it moves with group).

My code :

```
 //LEVEL OBJECTS
  //FallingPlatforms
  this.fallingPlateforms = this.physics.add.group({
allowGravity: false,
immovable: true
  });
  // Let's get the spike objects, these are NOT sprites
  const fallingPlateformsObjects = map.getObjectLayer('fallingPlateforms')['objects'];
  //Rotation animation
  this.anims.create({
key: 'fly',
frames: this.anims.generateFrameNumbers('fallingPlateformsOn'),
frameRate: 20,
repeat: -1
  });
  //Wind particules
  const particles = this.add.particles('dust');
  

  // Now we create spikes in our sprite group for each object in our map
  fallingPlateformsObjects.forEach(fallingPlateformsObject => {
// Add new spikes to our sprite group, change the start y position to meet the platform
let fallingPlateform = this.fallingPlateforms.create(fallingPlateformsObject.x, fallingPlateformsObject.y, 'fallingPlateformsOn');

//Remove bottom collision
fallingPlateform.body.checkCollision.down = false;
fallingPlateform.body.immovable = true;

//Create emmiter for wind
let platformEmitter = particles.createEmitter({
  speed: 150,
  angle:90,
  emitZone:{
    type: 'random', // 'random', or 'edge'
    source: new Phaser.Geom.Rectangle(-12, 0, 24), // Geom like Circle, or a Path or Curve
  },
  on: true,
  blendMode: 'ADD',
  scale: { start: 0.6, end: 0 },
  alpha: { start: 0.1, end: 0 },
  quantity:1,
  lifespan: 400,
});
platformEmitter.setPosition(fallingPlateform.x, fallingPlateform.y+10);
platformEmitter.on = true;
//platformEmitter.startFollow(fallingPlateform);

//Create animation for mooving the
this.tweens.add({
  targets: fallingPlateform,
  y: fallingPlateform.y + 10,
  duration: 2000,
  yoyo: true,
  repeat:-1,
  delay:Phaser.Math.Between(0, 1000)
});
  });
  //play animation for all childrn of the group
  this.fallingPlateforms.playAnimation('fly'); 

```

Could you help me please ?

Sorry for my english, i do m best.

---

<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:** [April 6, 2020, 5:03pm UTC](https://phaser.discourse.group/t/phycis-group-vs-physic-staticgroup-issues/5796/2 "2020-04-06T17:03:47Z")

</div>

Perhaps a tween with target: fallingPlatform.body

---

<div class="post-metadata">

**Author:** ![Nik0w](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/nik0w/32/692_2.png) [@Nik0w](https://phaser.discourse.group/u/Nik0w)\
**Post date:** [April 6, 2020, 9:35pm UTC](https://phaser.discourse.group/t/phycis-group-vs-physic-staticgroup-issues/5796/3 "2020-04-06T21:35:56Z")

</div>

Already tried, the sprites is not moving so.  
If I tween sprite and body, in same tween, they are not sync…

---

<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:** [April 7, 2020, 12:11pm UTC](https://phaser.discourse.group/t/phycis-group-vs-physic-staticgroup-issues/5796/4 "2020-04-07T12:11:53Z")

</div>

Hmm, ok let’s try with a timer, test this code in phaser3 sandbox( accessible from any examples with the edit button)

```javascript
var config = {
    type: Phaser.AUTO,
    width: 800,
    height: 600,
    parent: 'phaser-example',
    physics: {
        default: 'arcade',
        arcade: {
            debug: true,
            gravity: { y: 0 }
        }
    },
    scene: {
        preload: preload,
        create: create
    }
};

var game = new Phaser.Game(config);

function preload ()
{
    this.load.image('block', 'assets/sprites/block.png');
}

function create ()
{
    var group = this.physics.add.group({
        collideWorldBounds: true
    });

    var block1 = group.create(100, 300, 'block').setVelocity(0, 100);
    var block2 = group.create(300, 300, 'block').setVelocity(0, -100);
    var block3 = group.create(500, 300, 'block').setVelocity(0, 100);

    this.time.addEvent({
        delay: 2000,
        loop: true,
        callback: function () {
            group.children.entries.forEach(platform => platform.body.velocity.y *= -1);
        }
    });

    this.physics.add.collider(group, group);
}

```

---

<div class="post-metadata">

**Author:** ![Nik0w](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/nik0w/32/692_2.png) [@Nik0w](https://phaser.discourse.group/u/Nik0w)\
**Post date:** [April 8, 2020, 11:23am UTC](https://phaser.discourse.group/t/phycis-group-vs-physic-staticgroup-issues/5796/5 "2020-04-08T11:23:10Z")

</div>

Hi, I explored this case too, I prefer to not use it thank you …
