HI there,
in Section 52 of the course on Udemy Sam learns use the cancel with IAction etc. Everything is working quit well, the only problem I have is that I am not able to cancel the Trigger Animation Effect so even if i cancel the following blast by moving the Ability Animation. I tried to restet the trigger but it doesnt work. I m quit new to c# and unity especially animations so maybe there is just a simple solution but I dont get it right now:
using System;
using System.Collections;
using UnityEngine;
namespace RPG.Abilities.Effects
{
[CreateAssetMenu(fileName = "Trigger Animation Effect", menuName = "Abilities/Effects/Trigger Animation", order = 0)]
public class TriggerAnimationEffect : EffectStrategy
{
[SerializeField] string animatonTrigger;
[SerializeField] bool abortIfCancelled = false;
public override void StartEffect(AbilityData data, Action finished)
{
Animator animator = data.GetUser().GetComponent<Animator>();
animator.SetTrigger(animatonTrigger);
if (abortIfCancelled && data.IsCancelled())
{
animator.ResetTrigger(animatonTrigger);
}
finished();
}
}
}
TY for any help.