Attachments ModuleΒΆ

The Attachments module provides a utility hand model that you can to use to accomplish a variety of tasks such as hand-mounted UI controls and placing components that use the transforms of the different parts of the hand (like a fireball emitter). Using a utility hand model for these tasks lets you separate the concerns of game logic, graphics, and physics. This allows you to change the graphics of your hand without having to rebuild your hand prefabs, for example.

The attachment points include: the palm, the fingertips, the center of the arm, as well as a pinch point and a grab point that are calculated from the finger positions.

The Attachments module contains the following prefabs:

  • HandAttachments prefab – the main hand model to add to the hand pool.
  • Transition prefab – provides animation when turning on and off attachments.

And the following scripts:

  • HandAttachments – the IHandModel implementation exposing the attachment transforms.
  • AttachmentController – controls how attachments are turned on and off.
  • ITransition – the base class for transitions.
  • Transition – animates the transform and color of attached game objects when the AttachmentController Activate() and Deactivate() functions are called.
  • CameraFollower – rotates the object to which it is attached to always face the camera. Avoid using both a CameraFollower and a Transition at the same time.