Skip to content

ormesam/splatter.ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Splatter.AI

Splatter.AI is a code based behaviour tree for Unity projects. Current version v0.0.6 can be found in the releases, note there may be breaking changes while in early preview.

Installation

To add to your Unity project go to the Package Manager, click the plus in the top left of the window. Select git URL and enter: https://github.com/ormesam/splatter.ai.git?path=/src/Assets/Splatter.AI

Quick Start More Docs...

  1. Create new class deriving from BehaviourTree
  2. Override Awake method (optional) and initiate blackboard values, make sure to call base.Awake(); at the start of the method
  3. Override CreateRoot method, here you can build up your behaviour tree using the BehaviourTreeBuilder class as shown below
  4. Attach the script to the GameObject
  5. The tree will be executed every frame

View the wiki for more documentation.

Example

using Splatter.AI;

public class ZombieBehaviourTree : BehaviourTree {
    public override void Awake() {
        base.Awake();
        
        Blackboard[ZombieKey] = GetComponent<Zombie>();
    }
    
    protected override Node CreateRoot() {
        return new BehaviourTreeBuilder(this)
            .Sequence()
                .Name("root")
            	.Do("custom action", () => {
                    return NodeResult.Success;
                })
            .End()
            .Build();
    }
}

Patrol / Chase Demo

Found under Samples

Example.mp4

About

Code based behaviour tree AI for Unity

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages