Trying to add matter Physics to a full arcade project

Hi everyone,
I’ve been trying for a while now to add a pull feature to my project. I need several fixed stars which attract my character. So I looked in matter, which has this functionality. But my project was totally designed for
arcade physics, and although arcade and matter can be used at the same time, it can’t be done! Could someone help me?

I leave you my github with my project. Don’t pay attention to the many comments they are not from me Im a student. btw i’m french

Go check:
mais.js
TiledPlatformer/src/ scenes / (line 49)
or in structure folder

You might try making the attractors in Arcade Physics. You can apply forces by adding to velocities. But here is the game config:

const config = {
  scene: [
    new Ui(),
    new TableauTiled({
      key: 'Tiled test',
      physics: {
        arcade: {
          debug: true,
          gravity: { y: 100 * 3 }
        },
        matter: {
          debug: true,
          gravity: { y: 0.5 }
        }
      }
    })
  ]
};
1 Like

Thank you very much ! indeed I was able to put a matter object! (github is update, and btw this morning I tried to send you a private message haha) I tried to put an object of an example of attraction there (Phaser 3 Examples) to test.
But I just realized, if I want my player to be attracted to this object, does my player also have to be a matter object?
I don’t really know about the physics matter, does that require a lot of change? (src / object / player2.js)

Hello,
I still have a few questions about matter and arcade, but I don’t think creating a topic here for each of my questions is the best idea, is it possible to speak privately (or here) for help me ? Thank you

You could make one new thread for all the questions if you like. I don’t know much about Matter, I’m afraid. :smiley:

No prblm ! Thank you anyway, you risk seeing my problems go through so haha, I’ll try to do everything with “arcade” btw :slight_smile:

Btw, i’ve got a other problem maybe link to this one. It may can help someones