Animating Hand Poses

The InteractableAnimationController is a Component that allows us to link Animations made for a Grabbable object to its Handposes.

In this example, we will create an Activate Pose for the left hand for the alcohol spray bottle and utilize the InteractableAnimationController to animate its activation.

../../../../_images/new_animation_preview.gif
  1. Create an Animation for the Grabbable object. In this scenario, we have created an Animation for the Alcohol_Spray object that pulls the trigger of the spray bottle. If you want to learn how to create your own Animations, you can check it out in the Unity’s Documentation

    ../../../../_images/new_animated_hand_pose.gif
  2. Add an Animator Component to the Grabbable object and set it up according to your preferences. In this example, we have added only the Animation mentioned before inside the Animator of the Alcohol_Spray object and added a float parameter named ActivationIntensity, which affects the Motion Time of the Animation.

../../../../_images/animator_preview.png
  1. In the Grabbable object’s Inspector, click on the Add Component button and select the InteractableAnimationController Component.

../../../../_images/select_interactable_component.png
  1. Inside the InteractableAnimationController Component, delete the Selection Intensity Animator Float Value field, as we will only animate the Activate Pose and not the Select Pose.

../../../../_images/delete_select_parameter.png
  1. Click on New to create a new HandPose for the Activation Pose field. Make sure to create a HandPose for the left Interactor just like its shown in the Hand Poses tutorial.

../../../../_images/create_hand_pose.png
  1. Make sure your Animation HandPose is inside the Activation Pose field.

../../../../_images/activate_pose_set.png

Now when we use the spray bottle, the left Hand Indicator will take the Activate Pose we created, and the bottle will play the Animation.