Skip to content

Commit

Permalink
Update README docs
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonlamb committed Feb 5, 2017
1 parent a4158da commit ce73f79
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ sm.set_transitions([
{"state_id": "patrol", "to_states": ["idle"]}
])
# Add a single transition
sm.add_transition("idle", "patrol")
sm.add_transition("patrol", "idle")
# Add the target node/object to the state machine
sm.set_target(get_tree().get_root().get_node("enemy"))
Expand All @@ -94,16 +98,6 @@ sm.set_target(get_node("player"))
var player = sm.get_target()
```

### State Machine Initial State

```gdscript
# Set the state machine's initial state
sm.set_current_state("sleeping")
# Get the state machine's initial state
var id = sm.get_current_state()
```

### State Machine Current State

```gdscript
Expand Down

0 comments on commit ce73f79

Please sign in to comment.