---
title: stateMachine
framework: gameplaykit
role: symbol
role_heading: Instance Property
path: gameplaykit/gkstate/statemachine
---

# stateMachine

The state machine that owns this state object.

## Declaration

```swift
weak var stateMachine: GKStateMachine? { get }
```

## Discussion

Discussion Use this property to refer to the state machine this state object is being used in.

## See Also

### Working with State Machines

- [isValidNextState(_:)](gameplaykit/gkstate/isvalidnextstate(_:).md)
