Yes, a state machine — it basically designs logic that changes behavior. Think of when you're idle and you move: you switch from the idle state to the walk state. I highly recommend you use Limbo AI, a Godot addon — watch this video.