Quantcast
Channel: WhyDoIDoIt.com » Topic: Finite State Machine Problems
Viewing all articles
Browse latest Browse all 3

Reply To: Finite State Machine Problems

$
0
0

The solution to 1. appears to be the need for a yield statement after the Call(). That is:

Call(States.MyState);

yield return null;

 

The solution to 2. is my own terrible error and I apologize for not recognizing it earlier. The FSM defines an Update() method — do not define one in your derived class without also calling base.Update(). To make this easier for myself to remember, I protected the FSM’s Update method, as well as the other parallel MonoBehaviour methods, so that my child classes receive a Unity Warning if they override them. To remove the warning, add the “new” keyword and add in that call to the base method.


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images