How do i move an actor in the behavior tree if the actor is not a pawn?

I have this actor that has just a static mesh pyramid.
Im trying to apply an AI to it. But it seems AI only works with Pawns?
Also i dont want to use the native function AIMoveTo.
Id rather just send them using vinterpTo.

So basically.
If most of my game is done using actors, and vinterping them is how i move them. How can i use Behavior Trees for the AI. Did i shoot myself in the foot?

You could use the MoveComponentTo node in your task, and move the RootComponent of your actor, which will essentially move your actor

1 Like

To use AI directly you need to have at least a pawn class. Pawns can have AI controllers assigned and run behavior trees.

You could also just calculate the paths via an AI actor (saves to a vector array) and use the result to move actors via transform lerp.

But if you want blackboards and BT’s on a per actor basis then I’m afraid you need to switch to pawns or roll your own tech to overwatch actors.

1 Like

As usual i made a mistake here when answering :upside_down_face:. So im going to try it again:
This is because its an RTS. So im not possessing any units, because a lot of times im moving many units at the same time, and in specific formations.
So i did it all in c++…
And now that i have to do the AI, i might have to do it in c++ entirely.
Unless i do something similar to what you suggested.
Like create a Pawn actor, that is just so i can use the behavior tree. Then make it communicate with each specific unit?
Do you think i could pull this off. Or just keep going with my c++ crazy code?

The move component to will still have the same issue because im using actors. So i cant use the actor in the BT. Though thanks for the suggestion. I tried to think of something like using a temporary pawn just to get the AI working. im doing an rts so this is confusing to set up in unreal, because its a lot of units, and they have a very specific set up.

You’d probably be best off to get the nav points through an actor and pass t he array to other units. The problem with this is that the specific unit regiments will not take into account each other’s paths when traversing the terrain.

Anyway for larger scale AI traversal flow fields are usually used.

It’s a path cost analysis baked into the terrain in a way that allow quick calculations to avoid obstacles.

There are plugins for it in the marketplace or there are a couple of youtube videos that go in depth of the mechanics (most for unity though)

You can actually run a Behavior Tree without an AI Controller, but you can’t use a blackboard as far as I know
Just use the Receive Execute override instead of the AI version of it
image

that is fine. im not using pathfinding. they just clash against things and do stuff according to that with the OnOverlapEvent. i know its basic, but thats what i want.

So all i need is for the Behavior tree to work without being a pawn, and with it being able to communicate with the actors to move to a location.
Because the only obstacles in the game are other units, i dont need pathfinding.
I only need events when they clash.
So imagine you have like many actors, thats your units, and you are moving them around using vinterp.
Cool. they move and fight. Now you need an AI to command them? What do you do?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.