Hello everyone! Can you please tell me if I can somehow set gravity for one object so that it acts by attraction on another object? as I understand it, createGravityWell won’t work for me
If you are using matter physics, you can add a constraint between 2 objects.
The constraint has a length property which you can update.
let myConstraint = this.matter.add.constraint(ballA, ballB, 100, 0.2);
myConstraint.length = myConstraint.length - 1; // somewhere in an update function
1 Like
Matter actually has an attractors plugin.
1 Like
this is a great example and advice! however, how do I use matter physics if my game already uses arcade physics?
Or just change everything to matter.