Category: Objects
/ Display
Since engine version: 5.1 OC
mesh
is an ID then the mesh of the corresponding definition is used. If mesh
is an object then the current mesh of that object is used, including all its animations and attached meshes. However, in that case only the graphics will be attached - the object itself stays at its current position. The return value is a number that can be used to detach the mesh again via DetachMesh.|
. The following values are allowed:
Flag | Description |
---|---|
AM_DrawBefore | Normally the mesh of the object itself is drawn first and afterwards the attached mesh. If this flag is present then the attached mesh is drawn before the object's mesh is drawn. Note that normally this makes no difference since a Z buffer is used to make sure the drawing order is correct. However if one or both of the meshes make use of alpha blending then the drawing order becomes relevant so that a mesh is not hidden behind otherwise (partly) translucent parts of the other mesh. |
AM_MatchSkeleton | Normally the attached mesh uses its own animations. If this flag is set, then the attached mesh uses the animation data of the parent mesh for all bones that have the same name as a bone in the parent mesh skeleton. |
transformation
can be used to transform the attached mesh.AttachMesh(Bow, "pos_hand1", "main");