Set Actor Reference in Behaviour Tree Task

Hey,

I have the following Problem:

I’ve created a behaviour tree task. At the moment it is completely empty. The only thing I added is a public Actor reference variable.

132033-unbenannt.png

Now when I am calling the Task from within the behaviour tree the variable shows up and is apparently settable.
But no matter if I try to add objects from my scene via DropDown menu or via Drag and Drop direct from the scene, the actor reference always remains on None.

My Workaround at the moment is to create a Name String Var and a Class Var, search for all actors from that class and get the correct actor by name. That sucks and is completely inefficient!

][2]

Behavior trees are level-agnostic, meaning they’re not tied to any specific level. That’s why you cannot use local actor references as parameters of BT nodes. The most common way of addressing that is having a blackboard key that would get populated with the Actor value an have BT use that BB key.

Cheers,

–mieszko

Thanks! That actually addresses the issue and also confirms something I thought about. Nevertheless,

The remaining Problem:

What do you mean with actor value?
I can’t save an actor as blackboard value. Wouldn’t make sense at all within the level-agnostic approach. I can save an object as blackboard value. But that doesn’t really help. If it is possible to save any kind of integer as the pointer to an actor it also would break the paradigm. So how I am supposed to get to an actor without breaking this paradigm or search the whole level?

The second Problem:

More of a usability issue than an actual Bug but any feedback when trying to add an actor as public var in a BT task would be great. I mean the Drop Down menu even suggests all actors of the current level (or more - didn’t check). But it is not possible to select any of them. That is the stuff of nightmares because I can’t be sure if it was my mistake or the mistake of the engine. At least it always looks like a mistake of the engine.

I think I’m having this issue right now but I don’t quite understand the explanation here. could someone provide some sort of example of this in practice?