to Update method or while loop • Can transition to another event with “Send Event” action – Recommended to supply Delay value or FSM may get stuck in an infinite loop • Use “Find Game Object” to access a static GameObject from a Prefab using a tag
A GameObject can have zero to many FSMs – FSM contains States, Events, Transitions and Variables • Create New – Select game object in Hierarchy tab – Right click PlayMaker pane – Select “Add FSM”
– Game Character • Standing, Walking, Running, Jumping • For a given FSM, only one state can be active at any given time • A state contains a collection of actions, executed from top to bottom
RigidBody • Add a PlayMaker FSM • Add Moving State • Input > Get Axis – Assign to X and Z variables • Transform > Translate – Assign variables to transform • Tip: Order of actions is important • Tip: Click double line button to enter static values
and Z rotation on RigidBody – Otherwise player will “fall over” • Default terrain map range 0 to 600 – Default height 0 – Impossible to go lower than 0
highlighted in green • Tip: Alt + Click state to manually transition to state • Events can not be called from another FSM unless it is marked Global • Variables are local to an FSM unless defined as a Global variable
state • Add “jump” event • Add Input > Get Button Down action – Send jump event • Transition to Jumping on jump event • Add Force action • Transition to Idle on FINISHED event
First Person mouse controls – Action must be on the player object, not the camera! • Uses airplane joystick view control by default • Set Sensitivity Y to negative value to enable traditional first person shooter controls