Brainevents and State Brainboxes
Brainevents activate gameplay features and logic in a sequential order that is determined by the object or player action. State Brainboxes allow you to activate the Brainevents that they are attached to, and contain predefined gameplay features and functionalities such as animation, data, motion, and outcomes.
The following example is a 2D character asset that contains multiple Brainevents and State Brainboxes:
|When the asset is created in the game, the Idle Brainevent activates, which in turn activates the Idle State Brainbox that plays an animation.||After the player presses a movement key, the Idle Brainevent deactivates and the Run Brainevent activates along with the Run State Brainbox that moves the character while playing an animation.||After the player releases the movement key, the Run Brainevent deactivates and the Idle Brainevent activates. The character stops moving and plays its Idle animation.|