im new to animations ^ ^
i have a 3d model “humanoid” and attached to it a character controller
i have 2 animation “run” & “jump”
the run aniamtion i the default state (the game is an endless runner
and have this script attached to the player :
using UnityEngine;
public class player_mov : MonoBehaviour {
private CharacterController cc;
private Animator anim;
public float speed;
// Use this for initialization
void Start () {
cc = GetComponent<CharacterController> ();
anim = GetComponent<Animator>();
}
// Update is called once per frame
void Update () {
cc.Move (Vector3.forward * speed* Time.deltaTime );
if (Input.GetKey(KeyCode.LeftArrow)) {
cc.Move (Vector3.left * speed* Time.deltaTime );
}
if (Input.GetKey (KeyCode.RightArrow)) {
cc.Move (Vector3.right * speed* Time.deltaTime );
}
if (Input.GetKey (KeyCode.Space)) {
anim.Play ("JUMP");
}
}
}
with this i have 2 problems :
1-the jump animations play but dont go back to run animation
2-when i jump and then go back to running the run animation dont start from where the players has completed his jump but from thhe place which he started the jump
so if anyone can explain me in details how to make transitions between animation with custom input
and the problem n’2
n2 problem :
i just found that the character controller dont follow the player when he jumps !
so how to make it follow him