I need help going from the walk animation to run animation with blend.
when i press left shift the character walks faster but when i click left shift i also want the run animation to work, this is my script & blend tree
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour
{
private float currentMaxSpeed = 0;
[SerializeField]
private Animator anim;
[SerializeField]
private float walkSpeed;
[SerializeField]
private float runSpeed;
void Start()
{
anim = GetComponent<Animator>();
}
void Update()
{
if (Input.GetKey(KeyCode.LeftShift))
{
currentMaxSpeed = runSpeed;
}
else
{
currentMaxSpeed = walkSpeed;
}
Vector3 movement = new Vector3(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"), 0.0f);
anim.SetFloat("Horizontal", movement.x);
anim.SetFloat("Vertical", movement.y);
anim.SetFloat("Magnitude", movement.magnitude);
transform.position = transform.position + movement * Time.deltaTime * currentMaxSpeed;
}
}

