Visual State Machine
  • Welcome
  • FAQ
  • Get Started
    • Setup
    • How to Create a State Machine
    • How to Open the Graph Editor
    • How to Create a State
    • About State IDs and Renaming States
    • How to Duplicate States
    • How to Set the Entry State
    • How to Create a Transition
    • About Transition IDs and Renaming Transitions
    • About Transition Labels
    • How to Trigger a Transition
    • How to Trigger a Transition by Label
    • How to Listen to Graph Events
  • Advanced
    • Execution Order
    • Listening to Events from Script
    • Writing Custom State Behaviours
    • Extending VSM
Powered by GitBook
On this page
  • Do I need coding knowledge to use the asset?
  • Is Visual State Machine fast enough for my game?
  • Can I listen to state machine events from scripts?
  • Can VSM be used to create different states for my AI game characters?

Was this helpful?

FAQ

PreviousWelcomeNextSetup

Last updated 2 years ago

Was this helpful?

Do I need coding knowledge to use the asset?

You can setup your state machines and event logic completely in the inspector without needing to write a single line of code. Still, if you have some scripting knowledge you can make use of VSMs full potential by listening to events from script and writing custom State Behaviours.

Is Visual State Machine fast enough for my game?

Visual State Machine has been developed to have a very low overhead and should easily handle large graphs at runtime without having a great impact on your games performance.

Can I listen to state machine events from scripts?

Yes, one of the great strengths of VSM is that you can not only setup events directly in the inspector but also can listen to state and transition events from scripts. That gives you a great flexibility and for example allows you to write custom logic which will only be executed when a specific state is entered. For more details, check out the and section.

Can VSM be used to create different states for my AI game characters?

Yes! You can make use of VSMs Scripting API to write State Behaviours for your different states (). You could for example have an Idle, Patrol and Attack state and write a dedicated script for each of these states, which execute the desired behaviour when the states are entered and active.

Listening to Events from Script
Writing Custom State Behaviours
https://gameprogrammingpatterns.com/state.html#the-state-pattern