Need help with physics in Game Maker Studio
Posted: Fri Jun 30, 2017 5:51 am
I want to be able to give an instance more speed when I click the mouse closer to it. So far the best code I have made is:
But If you try this you will notice that the instance will get more speed the farther away you press the mouse from the instance. I want to reverse this; that the instance will get more speed the closer I get to it. Anyone got an idea?
Code: Select all
physics_apply_impulse(mouse_x, mouse_y, (((phy_position_x - mouse_x) / 2) * 10), (((phy_position_y - mouse_y) / 2) * 10));