|
Post by andrean on May 8, 2023 16:27:39 GMT
Premised i have downloaded and imported the last version of Invector Fsm Ai Template, using the component vFSMBehaviourController I was not able to get the event "onStateEnter" called, so, checking the code, i noticed it is not referencend by anything.
Instead, i noticed the event "onStateExit" is also called where not supposed to be.
if (state && state != currentState && !inChangeState) { inChangeState = true; _lastState = currentState; currentState = null; if (_lastState) { if (debugMode) SendDebug("<color=red>EXIT:" + _lastState.name + "</color>" + " "+"<color=yellow> ENTER :" + state.Name + " </color> ", gameObject); _lastState.OnStateExit(this); onStateExit.Invoke(_lastState); } currentState = state; state.OnStateEnter(this); inChangeState = false; onStateExit.Invoke(state); }
I think last line should be "onStateEnter.Invoke(state);", if i am not mistaken. I edited the code in this way and my game behaved the way it was supposed to.
If so, I hope this could be helpfull.
|
|
|
Post by Invector on May 12, 2023 13:32:48 GMT
Thanks for the report, this is indeed wrong on our side it should be onStateEnter instead of Exit on the last line. We will fix it for the next update
|
|