I was playing around with Unity and its 2D Animator. When I press a Button now (to play for example the walk left Animation) it takes about 1 sec to begin the animation and same when I release the button to stop it. It's the same problem with every other animation.
Here's my Player Movement Controller:
using System.Collections;
using UnityEngine;
public class Player_Movement : MonoBehaviour {
public float speed = 10;
float old_pos;
float old_height;
void Start()
{
old_pos = transform.position.x;
old_height = transform.position.y;
}
void FixedUpdate()
{
float h = Input.GetAxisRaw("Horizontal");
float v = Input.GetAxisRaw("Vertical");
Vector2 dir = new Vector2(h, v);
GetComponent<Rigidbody2D>().velocity = dir.normalized * speed;
GetComponent<Animator>().SetBool("isWalkingLeft", (h < 0));
GetComponent<Animator>().SetBool("isWalkingRight", (h > 0));
}
}
The problem also occurs when I switch directions and the animation should instantly switch over.
