Skip to content

Introduction to FlowPilot

Welcome! You’re in the right place if you’re just starting out. I’ll try to be as simple as I can. Let’s dive in!

Prep work

I’m starting this tutorial with a mostly empty level, you won’t need much more than that. I have a basic AI that doesn’t have a behavior and a couple of blocks, and triggers in the level.

MapView

Tutorial

Creating a FlowPilot Asset

  1. Flow Pilot Asset is found in Miscellaneous > Data Asset

    Data Asset Menu
  2. Search for FlowPilot

    Select FlowPilot
  3. Save the Asset. I’ll name mine FP_Tutorial.

    Tutorial Asset

Adding a FlowPilotComponent to an Actor in the Level

We can now add a UFlowPilotComponent to an Actor (you could do this to any Level Blueprint or Actor Blueprint as well.)

  1. Create any Empty Actor in the Level and add a UFlowPilotComponent to it.

    Add FlowPilotComponent Component to Actor
  2. Selecting the newly created component we can now reference the asset FP_Tutorial we have previously created.

    Link FlowPilot Asset
  3. Check Auto Start on Begin Play to start FlowPilot when we start the game.

  4. Execution Mode handles how FlowPilot Runs, and what happens on Success or Failure. For now, we can leave it as Run Once.

At this point, you have successfully created a new FlowPilot asset and have an actor that can run the Flow! AMAZING! Lets edit FlowPilot and start seeing it in action!

Editing Flow

  1. Open FP_Tutorial. You’ll see an editor with 3 panels. The left one is a full view of the asset, the middle one shows you the FlowTree and the right panel displays details when a Task is selected from the Tree.

    Tutorial Editor View
  2. Click on Root Sequence and then either Right Click -> Add Task or Add Button on the Toolbar. This will create a FPTask_Sequence by default. With Root Sequence still selected, head over to the Details Tab and change the class for Index[0] to Gameplay | Spawn Class.

    Add Spawn Class
  3. Select Spawn Class from the TreeView, and lets examine what we can do on the Details Tab.

    Spawn Class Details
  4. I’m going to select my AI for property Spawn Class. Feel free to use any class/actor/bp you’d like

  5. Save, and Run the game. Lets see what that does.

I’m going to make a few changes to the MainFlow.

  1. Go back to FP_Tutorial and select Spawn Class task

  2. Change Property ActorSpawnLifetime from FlowPilot to Persistent

  3. Save, and Run the game.

Change Spawn Location

Right now, the AI we’re spawning is using the Actor where UFlowPilotComponent was added, as the source location. This is done with the Property Spawn Location Reference. This property is a custom type called FFlowActorReference.

You can read more about FFlowActorReference

Lets now change where we spawn the AI.

  1. Go back to FP_Tutorial and select Spawn Class task

  2. In the details panel, change Spawn Location Reference Scope from Self to In Level

  3. Lets create a new Actor in the level, and reference that in Level Actor

    Reference Spawn Actor
  4. Save and Run.

You should now see the Actor spawn at the new location.

There’s a third Scope option for FFlowActorReference which is Runtime. Runtime means the actor we want to find and use is not yet in the level. This is every actor that is spawned during gameplay, therefor at Runtime. The way FlowPilot handles this is using GameplayTags. FlowPilot uses GameplayTags to easily find single, or groups of actors that have the tag.

Referente by GameplayTag

I’ll leave this one for you as a task.

Add a Tag to any Actor in your level, and reference it. Does your actor spawn at that location?

Wrapping Up

You should now have a basic understanding of how to create, edit, and run FlowPilot. We covered how to create an asset, linking the asset to a UFlowPilotComponent, spawn actors in game, and use GameplayTags to find Actors. These constitute the barebones of FlowPilot.

Go explore other more in depth Guides. Happy game developing!