physics_world_update_speed

Sets the speed at which the physics system will update.

Syntax:

GML Code Example

physics_world_update_speed(speed)


Argument Description
speed the number of times per second that the physics system updates


Returns: N/A


Description

GameMaker: Studio updates things based on the room speed, so that if you set it to ,say, 30, GameMaker: Studio will run 30 steps in the course of a second. However, for the physics functions that may not be enough and you may want things to be updated at a slightly faster speed to increase stability or precision. To that end we use the function physics_world_update_speed which sets the update speed for the physics system independently of the room speed. This means that you could have a room speed of 30, but set the physics to 60, effectively doubling the speed at which the physics system updates and performs its calculations compared to the speed at which the step are updated.

Note: you cannot currently set this to any less than room speed, but future updates may change this.


Example:

GML Code Example

physics_world_update_speed(room_speed * 2);

The code above sets the physics system update speed to be twice that of the room speed.





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here