FixObjectToObject

Description

Fixes an object to another object so that any movement of the parent also affects the child. The object being fixed uses its current position, rotation, and scale as an offset to the parent. For example if the parent was placed at 10,5,0 and an object was fixed to it with the current position 0,10,0 then the child would now inherit the position of the parent, combine it with its own, and the child would be placed at 10,15,0. The same applies to rotation and scaling, so if the parent was rotated around the Y axis then the child would rotate by the same amount. Note that using GetObjectY on the child would only show its local position relative to its parent (in this case it would return 10). To get the final world position of the child use GetObjectWorldY on it, which in this case would return 15. There is no limit to the number of objects an object can have fixed to it, nor is there a limit to objects being fixed to objects which are fixed to other objects, just don't create any loops. To stop an object being fixed to anything set toObjID to 0 and it will become independent again.

Definition

FixObjectToObject( objID, toObjID )

Parameters