Hi guys I have a question: how can I delete an animation (bang) trigger by press key if one of my Player object (Crossbow) is deactivate?:
Is it correct my script? Thank a lot
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class deletebow : MonoBehaviour
{
public Animator anim;
public GameObject Crossbow;
// Use this for initialization
void Start()
{
anim = GetComponent<Animator>();
}
// Update is called once per frame
void update()
{
if (Crossbow.activeSelf)
{
anim.SetBool("bang", false);
}
}
}