coins = this.physics.add.staticGroup();
coins.create(425, 325, 'coin').setScale(0.05)
coins.create(35, 175, 'coin').setScale(0.05)
coins.create(750, 35, 'coin').setScale(0.05)
coins.create(1200, 150, 'coin').setScale(0.05)
coins.create(900, 875, 'coin').setScale(0.05)
coins.create(1850, 875, 'coin').setScale(0.05)
coins.create(1850, 725, 'coin').setScale(0.05)
coins.create(1000, 425, 'coin').setScale(0.05)
coins.create(1650, 575, 'coin').setScale(0.05)
coins.create(400, 580, 'coin').setScale(0.05)
coins.create(100, 875, 'coin').setScale(0.05).refreshBody();
this.physics.add.collider(coins, platforms);
coins.body.setAllowGravity(true);
I would like to add gravity to the coins in my game but I think that using a staticGroup makes it impossible to add gravity, please help me add gravity to these coins. I have tried using arcadeGroup but I may have been doing it wrong. Any help is appreciated. Also if the question needs work I am happy to hear feedback. The coins just fall through the platforms and freeze the player as soon as the game starts
Why don't you use this.physics.add.group(); for the coins.
You will not have to call the functions setAllowGravity and refreshBody on the created objects, when you use the "normal"/dynamic group.
here is the link to the documentation.
And here a link to a good phaser example / working demo: https://phaser.io/examples/v3/view/physics/arcade/basic-platform#
Information: the freezing ot the player is probably an error, you could check the browser debug console.