|obj||The index of the object to check|
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
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.