object_index

Returns the index number of the object that the instance has been made from.

Syntax:

object_index


Returns: Real


Description

This read only variable returns the index of the object that the instance has been created from. This is not the same as the object name, which is a string and can be found using object_get_name, as this function returns the index number, which is a unique number that GameMaker: Studio assigns to every object at the time of creation.


Example:

obj_name = object_get_name(object_index);

The above code will use the object_index to find the name of the object that the current instance has been created from.


Back: Instance Properties
Next: id
© Copyright YoYo Games Ltd. 2018 All Rights Reserved