# How i can set gravity for one object so that it acts by attraction on another object?

**URL:** <https://phaser.discourse.group/t/how-i-can-set-gravity-for-one-object-so-that-it-acts-by-attraction-on-another-object/9759>\
**Category:** Phaser 3\
**Created:** [June 9, 2021, 6:19pm UTC](https://phaser.discourse.group/t/how-i-can-set-gravity-for-one-object-so-that-it-acts-by-attraction-on-another-object/9759 "2021-06-09T18:19:53Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Milton](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@Milton](https://phaser.discourse.group/u/Milton)\
**Post date:** [June 10, 2021, 8:32am UTC](https://phaser.discourse.group/t/how-i-can-set-gravity-for-one-object-so-that-it-acts-by-attraction-on-another-object/9759/5 "2021-06-10T08:32:36Z")

</div>

> [@Can't get arcade physics to work alongside matter physics](https://phaser.discourse.group/t/cant-get-arcade-physics-to-work-alongside-matter-physics/9692/4):
>
> class GameScene extends Phaser.Scene { constructor () { super({ key: 'game', physics: { arcade: { debug: true, gravity: { y: 0 } }, matter: { debug: true, gravity: { y: 0 }, debugShowBody: true, debugBodyColor: 0x0000ff } } }); } } var config = { // … scene: [BootScene, GameScene] };

Or just change everything to matter.

---

_[View the full topic](https://phaser.discourse.group/t/how-i-can-set-gravity-for-one-object-so-that-it-acts-by-attraction-on-another-object/9759)._
