Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEngine.InputSystem;
- public class handcontroller : MonoBehaviour
- {
- public InputActionReference gripIn;
- public InputActionReference trigIn;
- private Animator m_Animator;
- private void Awake()
- {
- m_Animator = GetComponent<Animator>();
- }
- private void Update()
- {
- if (!m_Animator) return;
- float grip = gripIn.action.ReadValue<float>();
- float trigger = trigIn.action.ReadValue<float>();
- m_Animator.SetFloat("grip", grip);
- m_Animator.SetFloat("trigger", trigger);
- Debug.Log(trigger);
- Debug.Log(grip);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment