---
title: "Creating a State Class"
content_type: tutorial
url: "https://learn.unity.com/tutorial/creating-and-using-a-state-class?language=en"
language: en
difficulty: intermediate
duration_minutes: 20
unity_version:
  - "6.0"
supported_unity_versions:
  - name: "6.0"
    url: "https://learn.unity.com/tutorial/creating-and-using-a-state-class.md?language=en&version=6.0"
  - name: "2021.3"
    url: "https://learn.unity.com/tutorial/creating-and-using-a-state-class.md?language=en&version=2021.3"
  - name: "2019.4"
    url: "https://learn.unity.com/tutorial/creating-and-using-a-state-class.md?language=en&version=2019.4"
  - name: "2019.3"
    url: "https://learn.unity.com/tutorial/creating-and-using-a-state-class.md?language=en&version=2019.3"
  - name: "2019.2"
    url: "https://learn.unity.com/tutorial/creating-and-using-a-state-class.md?language=en&version=2019.2"
  - name: "2019.1"
    url: "https://learn.unity.com/tutorial/creating-and-using-a-state-class.md?language=en&version=2019.1"
last_updated: "2026-08-04T14:22:34.000Z"
---

# Creating a State Class

In this tutorial, students will learn how to create the base state class and ensure it is hooked up to the NavMesh system to help control the NPC.

## Creating a State Class

[Video](https://storage.googleapis.com/learn-platform-bucket-production/tutorial/582c3edd-33f4-516e-9f9d-7f72041629b1/versions%5B_key==%22c7918a0c68a19089d0dbe256d2ad0360%22%5D.sections%5B_key==%22u6X2hMV4GZ96GPitLOSbqd%22%5D.body%5B_key==%22u6X2hMV4GZ96GPitLOSbsm%22%5D.overviewVideo/S0702_20260316_125818.mp4) ([Transcript (en)](https://storage.googleapis.com/learn-platform-bucket-production/tutorial/582c3edd-33f4-516e-9f9d-7f72041629b1/versions%5B_key==%22c7918a0c68a19089d0dbe256d2ad0360%22%5D.sections%5B_key==%22u6X2hMV4GZ96GPitLOSbqd%22%5D.body%5B_key==%22u6X2hMV4GZ96GPitLOSbsm%22%5D.subtitles/S0702%20VTT%20en_20260525_195620.vtt))
