More > Gaming > Working in Unity > Placing Locators

Placing Locators in Unity

In Unity, it's possible to assign a target to some part an imported Harmony animation. For example, in the Space Duck scene, the character has a gun. You may want to attach some other action to this animated gun, such as shooting spheres and cubes out of its end. For this, you need to place a locator at the end of the gun.

You can see some examples of this in the provided Unity project. The first example is in the demo scene DemoLocator, which shows a simple cylinder attached to the end of the gun.

The second example DemoCallback shows the gun shooting spheres and cubes.

You can access any drawing layer created in Harmony later in Unity and use its pivot point to attach objects and animated sequences. In Harmony, you should set the pivot points on your drawing layers with the Rotate tool.

You can also create an empty drawing layer in Harmony, when setting up your character, to be used later in Unity. Use Create Empty Drawing to create a blank drawing, then use the Rotate tool to set the pivot point on this drawing layer. In the Space Duck example, an empty drawing layer called hook_gun was created on which you can attach the locator in Unity.

When you access the imported Harmony character in Unity, you can access the data with a script.