- Home /
Animation Control Problem
I have used a the unity prefab from ThirdPersonCharacter to create a new one attached a camera to realize a FPS test which I could see the real charater itself reacting.
The inputH/inputV value is changing when pressing WASD, whereas the character just idling. Transitions between idling and moving are defined as below:
code: using System.Collections; using System.Collections.Generic; using UnityEngine; public class ainmationContoller_JM : MonoBehaviour { public Animator ani; private float inputH=0f; private float inputV=0f; void Start () { ani = GetComponent (); }
void Update () {
inputH = Input.GetAxis ("Horizontal");
inputV = Input.GetAxis ("Vertical");
ani.SetFloat ("inputH", inputH);
ani.SetFloat ("inputV", inputV);
Debug.Log (inputH);
Debug.Log (inputV);
}
}
1.png
(61.0 kB)
Comment