State changes and detection
We know how to change states now. However, what if we need a bit of setup when an actor enters a state, or we need to do a few things before it leaves that state? There are two functions we can use for this that we'll take a look at now, BeginState
and EndState
.
BeginState
First, let's take a look at BeginState
.