I just started using unity and I figured I’d start by making a character.
My character wont turn left or right when “Apply root motion” is disabled how ever it will when I enable it but then the animation stops. I think it’s a problem with the script but as I said I just started so I’m not sure whats wrong.
I messed around with the script a bit but still the same problem
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Anim : MonoBehaviour {
public Animator playerAnim;
// Use this for initialization
void Start ()
{
playerAnim = GetComponent<Animator>();
}
// Update is called once per frame
void Update ()
{
float walkInput = Input.GetAxis("Horizontal");
if (walkInput > 0f)
{
playerAnim.SetBool("Walking",true);
transform.eulerAngles = new Vector3(0,-90,0);
}
else if (walkInput < 0f)
{
playerAnim.SetBool("Walking",true);
transform.eulerAngles = new Vector3(0,90,0);
}
else
{
playerAnim.SetBool("Walking",false);
transform.eulerAngles = new Vector3(0,0,0);
}
}
}
It’s much easier to start making a psuedo character by just using movement, and not including animation.
Then you can get a feel for how it’s working and later add the animation. At least, in my opinion.