Skip to content


Repository files navigation

State Machine Unity

Nick Maltbie's State Machine Unity for State Machine management in unity projects..

State Machine Unity is an open source project hosted at

This is an open source project licensed under a MIT License.


Install the latest version of the project by importing a project via git at this URL:

If you want to reference a specific tag of the project such as version v1.0.0, add a release/#v1.0.0 to the end of the git URL to download the package from th auto-generated branch for that release. An example of importing v1.0.0 would look like this:

To use the latest release, simply reference:

For a full list of all tags, check the StateMachineUnity Tags list on github. I will usually associated a tag with each release of the project.

You can also import the project via a tarball if you download the source code and extract it on your local machine. Make sure to import via the package manifest defined at Packages\com.nickmaltbie.StateMachineUnity\package.json within the project.

For more details about installing a project via git, see unity's documentation on Installing form a Git URL.

Scoped Registry Install

If you wish to install the project via a Scoped Registry and npm, you can add a scoped registry to your project from all of the com.nickmaltbie packages like this:

"scopedRegistries": [
    "name": "nickmaltbie",
    "url": "",
    "scopes": [

Then, if you want to reference a version of the project, you simply need to include the dependency with a version string and the unity package manager will be able to download it from the registry at

"dependencies": {
  "com.nickmaltbie.StateMachineUnity": "1.0.0",


If you wish to include the testing code for this project, make sure to add the com.nickmaltbie.StateMachineUnity to the testables of the project manifest.

"testables": [


You can see a demo of the project running here: The project hosted on the website is up to date with the most recent version on the main branch of this github repo and is automatically deployed with each update to the codebase.


The samples in the project include:

  • ExampleFSM - Example Finite State Machine.


Documentation on the project and scripting API is found at for the latest version of the codebase.