I have added two events to animation and getting a “has no receiver”, I bet it’s something simple lol.
I have added them to the sword animation.
the code that calls it.
public class Weapon : MonoBehaviour
{
[SerializeField] UnityEvent onHit;
public List<TPHitBox> tPHitBoxes;
[SerializeField] GameObject uiContainer = null;
public bool friendly = true;
public void OnHit()
{
onHit.Invoke();
}
private void Start()
{
uiContainer.SetActive(false);
if (tPHitBoxes.Count > 0)
{
// initialize hitBox properties
foreach (TPHitBox hitBox in tPHitBoxes)
{
hitBox.weaponObject = this;
}
}
else
{
this.enabled = false;
}
}
void ToggleBoxOn()
{
uiContainer.SetActive(true);
}
void ToggleBoxOff()
{
uiContainer.SetActive(false);
}
}
and the error
I’m trying to use the animations to active and reactive the object like the ShowUI.