Hi all
I’m trying to animate the hands I created in blender and imported to Unity and I’m using the XR integration toolkit. As you can see in the video I’m reading the input from the controller and setting it in the blend tree but I can’t see the animations in play time.
Maybe someone could advise ?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class HandsController_2 : MonoBehaviour
{
[SerializeField]
private InputActionProperty pinchAnimationAction;
[SerializeField]
private InputActionProperty gripAnimationAction;
private Animator handsAnimator;
private string gripParameterName = "Grip";
private string triggerParameterName = "Trigger";
private void Awake()
{
handsAnimator = this.gameObject.GetComponent<Animator>();
}
void Update()
{
float triggerValue = pinchAnimationAction.action.ReadValue<float>();
handsAnimator.SetFloat(triggerParameterName,triggerValue);
Debug.Log(triggerValue);
float gripValue = gripAnimationAction.action.ReadValue<float>();
handsAnimator.SetFloat(gripParameterName, gripValue);
}
}