Crossy_Road_VR/Assets/Crossy Road VR/Scripts/AnimateHandOnInputScript.cs
2025-01-25 16:18:02 +03:00

29 lines
718 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class AnimateHandOnInputScript : MonoBehaviour
{
public InputActionProperty PinchAnimationAction;
public InputActionProperty GripAnimationAction;
public Animator HandAnimator;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
float tiggerValue = PinchAnimationAction.action.ReadValue<float>();
HandAnimator.SetFloat("Trigger", tiggerValue);
float gripValue = GripAnimationAction.action.ReadValue<float>();
HandAnimator.SetFloat("Grip", gripValue);
}
}