min

Returns the smallest of up to 16 real value arguments.

Syntax:

GML Code Example

min(val1, val2, ... val15);


Argument Description
val0 ... val15 The values to compare.


Returns: Real


Description

This function returns the minimum of the input values, of which it can have up to 16. For example min(12, 96, 32, 75) will return 12 as that is the lowest of all the input values.


Example:

GML Code Example

x = min(x, room_width);

This will stop the player from exiting the right of the room. This works by constantly setting its x to either itself or the room_width variable, whichever is smaller. If the player exits the right, its x would be larger than room_width, so it'll get set straight back.





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