Open SciJosh opened 1 year ago
You need to call applyForce before each update (https://brm.io/matter-js/docs/classes/Body.html#method_applyForce) The position vector should point towards the other body's center, and you can calculate the force based on the two body's position difference.
I am trying to get two bodies to attract to each other based on their mass's. I've tried using the plugin matter-attractors but I can't get it to work. Anyways, what would this look like in a script and how can it be manipulated?