FAQ

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 Listening to Events from Script and Writing Custom State Behaviours 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 (https://gameprogrammingpatterns.com/state.html#the-state-pattern). 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.

Last updated