# Statemachine to behaviour tree?

### Background

I was able to convert simple statemachines like this...

Into a BT looking like this (Notation describtion)...

root
sequence  #After another
playAnimation name:idle
sequence
walks? # Breaks current sequence if false
playAnimation name:walk
sequence
runs?
playAnimation name:run


### Goal

But how do we convert more complex multi-layered animation states into a behaviour tree ? How would such a BT look like ? The difficult parts here are transistions between the different states, something i couldnt solve in an BT.

### Question

Is it possible to convert every statemachine into a behaviour tree ? What does the theory says and how does it look like in practice ?