so i am making an open world game and the thing is when i click right mouse button, pistol animation should play but it does but however isaiming bool i checked
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FiringPistol : MonoBehaviour
{
public bool isAiming = false;
public GameObject thePlayer;
void Update()
{
if (Input.GetMouseButton(1))
{
isAiming = true;
thePlayer.GetComponent<Animation>().Play("Pistol");
}
else
{
isAiming = false;
//thePlayer.GetComponent<Animation>().Play("Idle");
}
}
}