Hi all,
Dabbling a bit with Matter physics but find the setOnCollide a bit strange in its use. I want to listen for a character hitting the world bounds. I can check that one body in the collision data is the player (by the name if the game object for instance) but I have two questions:
- What is the best way to check what the other object is? I don’t see anything that refers to the world in the bodyA or bodyB info. If the world is not involved, the best way is to refer to the name of the game object?
Brings me to the second question:
- Is the order of objects (bodyA, bodyB) something to rely on? I am used to Unity’s OnCollisionEnter and must say that I like it a lot better if there’s only one body info as a parameter. After all, one body is the one that has the event handler attached to it, right? Why have its info at all as a parameter?
I was thinking about using the setOnCollideWith, but that won’t work with the world, right?
Kind regards,
Manno