Godot Limbo AI Conditions

Godot Limbo AI Conditions

This article is all about Godot and LimboAI Behavior Tree Conditions. In previous articles I went over the basics of behavior trees and how to create a simple game with them.

If you haven't read the previous article you can check it out here:

You can check out the game here:

Behavior Tree Conditions

Conditions are a type of node that can be used to check the state of the game or the AI. They are used to determine if an action should be taken.

extends BTCondition

@export var target_var := &"target"

func _tick(delta: float) -> Status:
	var target: CharacterBody2D = blackboard.get_var(target_var, null)
	if target == null:
		return FAILURE
	return SUCCESS
  • First it extends from BTCondition as opposed to BTAction like a normal task would.
  • Then it exports a variable target_var which is the key in the blackboard that the condition will check.
  • If it has a target on the blackboard it will return SUCCESS otherwise it will return FAILURE.
  • It makes it easy to check if you have a target or not in your sequences.

Conditions typically don’t take multiple ticks to finish and return either SUCCESS or FAILURE immediately.

So in my case I have two sequences, a Wander sequence and an Attack sequence.

  • The Wander sequence will only run if there is no target.
  • The Attack sequence will only run if there is a target.

Conclusion

Conditions are a great way to check the state of the game or the AI. They are used to determine if an action should be taken.

Links


More Articles

Being a Developer and Dealing with Imposter Syndrome

Being a Developer and Dealing with Imposter Syndrome

The training you receive at your company wont prepare you for all that is necessary in completing certain tasks. However the greatest difficulty is the way we think about ourselves.

Godot WASD Keyboard Setup

Godot WASD Keyboard Setup

A guide to help you setup WASD keyboard controls in Godot.

Godot 12 Games in 2025

Godot 12 Games in 2025

Having goals is very important. This year in 2025 I will be planning to release 12 games.


Newsletter

Stay up to date with the latest articles, tutorials, and news.