Still figuring things out, been researching for a while on why an animation is not starting. Below is the code that is being used
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerTestScript : MonoBehaviour
{
public float moveSpeed;
public float horizontalMovement;
private Rigidbody2D rigidBody2d;
private Animator anim;
// Start is called before the first frame update
void Start()
{
rigidBody2d = GetComponent<Rigidbody2D>();
anim = GetComponent<Animator>();
}
// Update is called once per frame
void Update()
{
horizontalMovement = Input.GetAxisRaw("Horizontal");
rigidBody2d.velocity = new Vector2(horizontalMovement * moveSpeed, rigidBody2d.velocity.y);
//Walk Animation
if (horizontalMovement == 0)
{
anim.SetBool("isWalking", false);
if (anim.GetBool("isWalking"))
{
Debug.Log("isIdle");
}
}
else
{
anim.SetBool("isWalking", true);
if (anim.GetBool("isWalking"))
{
Debug.Log("isWalking");
}
}
}
}
I am able to see with the log that the bool is getting set to true, as well as in the animator (GIF)
Any thoughts or advice would be appreciated.