The "instance_link" Function
#
SyntaxArgument | Type | Description |
---|---|---|
parent | instance | The parent instance to link properties from |
child | instance/object/array | The child instance or collection of instances to link properties to |
pos | boolean | Enables or disables linking child instance position relative to the parent |
rot | boolean | Enables or disables linking child instance rotation relative to the parent |
scale | boolean | Enables or disables linking child instance scale relative to the parent |
#
DescriptionLinks an object, instance, or array of them to the parent instance so that all child objects match the parent's position, rotation, and/or scale. Links are relative, meaning child objects can still have their own independent position, rotation, and scale as well.
Unlike the child, the parent must be a specific instance. Use self
or id
to indicate the running instance. If an object is input as the parent, the first randomly detected active instance of the object will be used.
Must be run in the Step Event for changes to position, rotation, and scale to apply continuously.
important
This function depends on comparing values across time. It is highly recommended that you do not run instance_link
inside a conditional statement, as this can lead to incorrect results.