---
title: currentState
framework: gameplaykit
role: symbol
role_heading: Instance Property
path: gameplaykit/gkstatemachine/currentstate
---

# currentState

The state machine’s current state.

## Declaration

```swift
var currentState: GKState? { get }
```

## Discussion

Discussion A state machine can be in only one of its states at a time. To transition to another state, call the enter(_:) method. When you call the update(deltaTime:) method, the state machine calls the update(deltaTime:) method on its current state object.

## See Also

### Working with States

- [canEnterState(_:)](gameplaykit/gkstatemachine/canenterstate(_:).md)
- [enter(_:)](gameplaykit/gkstatemachine/enter(_:).md)
- [update(deltaTime:)](gameplaykit/gkstatemachine/update(deltatime:).md)
