AttachTo

The AttachTo method attaches an object to another object (the leader object) by using the other object’s ID which is given in the first argument. The attached object follows the leader object at the given offsets. This method can be used to create a formation of objects that move in a group using the path of the leading object as their path. Passing an empty string detaches the object from the object it is attached to.

 

JavaScript

 

AttachTo(

       ObjectID,

       DeltaX,

       DeltaY,

       DeltaAltitude

       DeltaYaw

       DeltaPitch

       DeltaRoll)

 

C#

 

void AttachTo(

       string ObjectID,

       double DeltaX,

       double DeltaY,

       double DeltaAltitude

       double DeltaYaw

       double DeltaPitch

       double DeltaRoll)

 

C++

 

HRESULT AttachTo(

       [in] BSTR ObjectID,

       [in] double DeltaX,

       [in] double DeltaY,

       [in] double DeltaAltitude)

       [in] double DeltaYaw,

       [in] double DeltaPitch,

       [in] double DeltaRoll);

Parameters

ObjectID

The ID of the object, on the terrain, that the current object attaches to. Passing an empty string detaches the object from the object it is attached to.

DeltaX

The distance between the x-coordinates of the attached objects. This number stays consistent while the objects are attached. A positive DeltaX places this object to the left of the leading object.

DeltaY

The distance between the y-coordinates of the attached objects. This number stays consistent while the objects are attached. A positive DeltaY places this object behind the leading object.

DeltaAltitude

The distance between the heights of the attached objects. This number stays consistent while the objects are attached. A positive DeltaAltitude places this object above the leading object.

DeltaYaw

The distance between the yaws of the attached objects. This number stays consistent while the objects are attached. A positive DeltaYaw places this object above the leading object.

DeltaPitch

The distance between the pitches of the attached objects. This number stays consistent while the objects are attached. A positive DeltaPitch places this object above the leading object.

DeltaRoll

The distance between the rolls of the attached objects. This number stays consistent while the objects are attached. A positive DeltaRoll places this object above the leading object.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.