object_get_depth

Returns the depth of the specified object.

Syntax:

object_get_depth(obj);


Argument Description
obj The index of the object to check


Returns: real


Description

With this function you can get the depth that was specified for an object in the resource tree. Please note that this is not an instance function! An object can have a different depth to an instance of that same object when in a room. You can set an individual instances depth using the depth instance variable.


Example:

if depth != object_get_depth(object_index) depth = object_get_depth(object_index);

The above example will check the depth of the instance against the depth of the object_index of the instance. If they are not the same, then it will assign the same depth as the one the object index has to the instance.


Back: Objects
Next: obj_get_mask
© Copyright YoYo Games Ltd. 2018 All Rights Reserved