Now the problem that I need help fixing is that when my play goes over the speed of 0.1 the walk animation start and if it goes over 3 the run animation starts. Currently, all the animation does is run. How do I make it work.
Here’s the script:
var runSpeed : float = 9000;
var moveSpeed : float = 3;
var walkingSpeed : float = 0.1;
var golemAnimator : Animator;
function Update ()
{
var input = Input.GetAxis("Horizontal");
if(input < walkingSpeed || input > walkingSpeed)
{
runSpeed = input*moveSpeed*Time.deltaTime;
transform.position.x += runSpeed;
golemAnimator.SetFloat("Running Speed", runSpeed);
}
}