Creating an Anchor for a Game Character
An anchor is simply a layer that has been marked as an anchor. Creating anchors is required to make props follow the animation of the layer they are rigged to.
In Unity, an anchor is a point, whereas a layer in Harmony is more like a canvas. Hence, the exact position of the anchor is based on the position of the layer's pivot point in Harmony. Because of this, it is recommended to create a layer specifically for the anchor in Harmony, instead of using one of your character's existing layers, so that you can position its pivot point without affecting your character's animation.
For example, if the character's hand is meant to be an anchor for a weapon prop, the hand's pivot point would usually be on the wrist to optimize animation, but you'd want the anchor for this hand to be positioned in the palm. Hence, you could create an empty drawing layer, rigged under the same peg as the hand, make this layer the anchor, and position its pivot point in the hand's palm.
- If the Game toolbar is not already in your workspace, do one of the following to add it:
- In the top menu, select Windows > Toolbars > Game.
- Right-click on any existing toolbar and select Game.
The Game toolbar is added to your workspace.
-
In the Timeline view, scroll to and select the layer for the body part which you want to use as an anchor.
- Create a new drawing layer by doing one of the following:
- In the toolbar over the layers list, click on Add Drawing Layer
- Right-click on the layer and select Insert > Drawing Layer.
- Press Ctrl + R
-
In the Add Drawing Layer dialog, type in a name for your anchor.
TIPTo make it easier to associate your anchor and its props in Unity, it is recommended to give your layer a name that indicates which prop it will be attached to. For example, if you are creating an anchor for a prop layer named Weapon, you could name it Weapon_anchor.
-
Click on Add and Close.
The anchor layer will be created as a sibling to the body part you previously selected. If you animated this body part's parent peg, the anchor layer will move at the same time as that body part.
-
In the Timeline view, select the first frame in the anchor layer.
-
In the anchor layer, create an empty drawing by doing one of the following:
- In the Timeline view, right-click on the first frame of the layer and select Drawings > Create Empty Drawing.
- In the top menu, select Drawing > Create Empty Drawing.
- Press Alt + Shift + R.
TIPIf you have Overlay and Underlay Art layers enabled, you can draw a cross hair in the Overlay or the Underlay art layer where the anchor's pivot is positioned, to help you keep track of the anchor's position. Artwork in Overlay and Underlay Art layers is not exported to Unity. You can find the Support Overlay and Underlay Arts preference in the Advanced tab of the Preferences dialog.
- Extend the exposure of the empty drawing until the end of your scene by doing one of the following:
- In the top menu, select Animation > Cell > Extend Exposure.
- Press F5.
The Extend Exposure dialog appears.
- In the Extend to Frame field of the Extend Exposure dialog, type in the amount of frames in your scene.
-
Click on OK.
The exposure of the anchor drawing is extended until the end of the scene.
-
In the Timeline view, double-click on the anchor layer (but not on its name) to open its Layer Properties dialog.
-
In the Transformation tab, under the Drawing Pivot section, open the Use Embedded Pivots drop-down and select either Don't Use Embedded Pivot or Apply Embedded Pivot.
- Close the Layer Properties dialog.
- In the Advanced Animation toolbar, select either the Translate, Rotate, Scale or Skew tool.
-
In the Camera view, click and drag on the pivot point and position it where you want the anchor to be positioned.
-
In the Game toolbar, click on Toggle Anchor.
The layer will now be an anchor. Its colour in the Timeline view will be changed to red.
In the Metadata Editor view, its Node Metadata should contain the following entry:
game.isAnchor
You now have an anchor layer for which you can create props.