-
Notifications
You must be signed in to change notification settings - Fork 145
Closed
Description
I've encountered this error and been struggling with it for a couple of days, and after doing every test i've came to the conclusion that it might not be my fault
I have a simple state machine with multiple states and one of which requiring an "AnyTransition", when i do so everything works correctly, it even shows correctly in the Animator Visualizator, but i get this error:

this is the interested code and proof that a state called "Stun" exists
void Start() {
StateMachine fsm = new StateMachine();
fsm.AddState("Stun",
onEnter: (state) =>
{
navMeshAgent.isStopped = true;
navMeshAgent.SetDestination(transform.position);
owner.transform.Rotate(new Vector3(0, 0, 90));
stunParticleSystemEffect.Play();
},
onLogic: (state) =>
{
stunTimer += Time.deltaTime;
if (stunTimer >= StunTime)
{
isStunned = false;
state.fsm.StateCanExit();
}
},
onExit: state =>
{
stunTimer = 0f;
owner.transform.Rotate(new Vector3(0, 0, -90));
stunParticleSystemEffect.Stop();
}, needsExitTime: true);
fsm.SetStartState("Neutral");
fsm.AddTransitionFromAny("Stun", t => isStunned, forceInstantly: true);
fsm.Init();
#if UNITY_EDITOR
HfsmAnimatorGraph.CreateAnimatorFromStateMachine(
fsm,
outputFolderPath: "Assets/Enemy/Dummy/DebugAnimators",
animatorName: gameObject.name + ".controller"
);
#endif
}
void Update()
{
fsm.OnLogic();
#if UNITY_EDITOR
HfsmAnimatorGraph.PreviewStateMachineInAnimator(fsm, fsmAnimator);
#endif
}
same happens if i use a TriggerTransitionFromAny, deleting the Animator and letting it create one still makes that error too
Mundzuk-Uldin
Metadata
Metadata
Assignees
Labels
No labels