• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM How To Use Torque.

C

C_Brown

Guest
Hey Guys!

I have used GameMaker for quite some time, but I have never really touched the physics engine. Right now I'm working on a game that requires me to have a square that pulls itself along the ground using physics.

Currently, I am apply this code into the Step event:
physics_apply_torque(100);
As I'm sure you can imagine, since this is applied every step, the square starts moving slowly and then picks up speed. By the end, it is bouncing past the View.

My theory is that I can get around this if I can check the current torque. If the current torque is over a certain value then add no torque. However, if the current torque is under the desired value, then I can apply the required torque to reach that value. Make sense? I don't see any kind of "check torque" or "get torque".

TL;DR - How can I make a physics square roll at a consistent speed. It needs to be able to go up and down obstacles.
 

jo-thijs

Member
I think you're looking for physics_apply_angular_impulse, which instantly sets the angular impulse.

If you really do want to know the current "torque" of the physics object (I think you actually mean angular momentum here),
you can use phy_angular_velocity.
 
Top