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.
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
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.
In the Grabbable object’s Inspector, click on the Add Component button and select the
InteractableAnimationController
Component.
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.
Create a new Handpose inside the Grabbable Component with the left Hand Interactor. This Handpose will be created by default as a new Hand Pose with the Select Pose set as the pose we have just created.
Note
You can set the Grabbable object in the position of the final frame of the Animation. When the Hand Pose scene stage opens in the creation process of a new Handpose, we can only reposition the Hand Interactor, and the Grabbable object will stay in the same position as inside the scene.
Remove the newly created element inside the Handposes Grabbable Component and set the Activate Pose of the Handpose representing the left hand’s pose to the new Hand Pose we have created.
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.