Physics Variables

Objects have certain variables associated with them automatically when used in the physics world.

As with the "traditional" collisions and movement system, the physics system also has a series of instance variables assigned to each instance of an object when it is created. Some of these properties can be defined by the user in GML, but many are read-only and still more are only applicable in the collision event.


The following variables exists in all physics enabled objects and they can be read to and written to (ie: changed) using code from instances and scripts:

Read Only Variables

Certain variables are read-only variables, which means that the information they contain cannot be changed through instance code or scripts (but it can be changed internally by GameMaker: Studio which is why these are variables and not constants). The following table shows the read-only variables that exist in all physics enabled objects:

Collision Only Variables

Finally, there are a number of temporary variables that exist in physics enabled objects and are created only in the collision event. These variables are like those listed above and are read-only:

Back: Physics

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