AttachObjectToObject

AttachObjectToObject

Description:
Function AttachObjectToObject attach objects to other objects. The objects will folow the main object.
Function AttachObjectToObject was added in 0.3a and will not work in earlier versions!
  • Both objects need to be created before attempting to attach them.
  • There is no player-object version of this function (AttachPlayerObjectToObject), meaning it will not be supported by streamers.


Parameters:
(objectid, attachtoid, Float:OffsetX, Float:OffsetY, Float:OffsetZ, Float:RotX, Float:RotY, Float:RotZ, SyncRotation)
int objectid The object to attach to another object.
int attachtoid The object to attach the object to.
float OffsetX The distance between the main object and the object in the X direction.
float OffsetY The distance between the main object and the object in the Y direction.
float OffsetZ The distance between the main object and the object in the Z direction.
float RotX The X rotation between the object and the main object.
float RotY The Y rotation between the object and the main object.
float RotZ The Z rotation between the object and the main object.
bool SyncRotation If set to 0, objectid's rotation will not change with attachtoid's. NOTE:Default value 1


Return Values:
  • 1: The function was executed successfully.
  • 0: The function failed to execute. This means the first object (objectid) does not exist. There are no internal checks to verify that the second object (attachtoid) exists.


Examples:
new objectid = CreateObject(...);
new attachtoid = CreateObject(...);
 
AttachObjectToObject(objectid, attachtoid, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1);


Related Functions
The following functions may be useful, as they are related to this function in one way or another.