Get Map Value


With this action you can retrieve the value associated with a given key in a map data structure. You supply the variable that holds the map index (as returned by the action Create Map) and then give a "key" (which is the identifier within the map for a value), and also supply a target variable to hold the returned value (which can be flagged as a temporary local variable).

NOTE: If you give a key that does not exist in the map then the action will return undefined. You can check for this this using the If Undefined action.

Action Syntax:

Get Map Value Syntax


Argument Description
Map The index (stored in a variable) of the map to get the value from
Key The key to get (real or string)
Target The target variable to hold the returned map value


Get Map Value Example
The above action block code checks for a collision at the instance position and if one is found the unique ID of the colliding instance is stored in a temporary local variable.