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.
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.