Can I get a instanced task node in C++?

I use BehaviorTreeComponent::GetActiveNode() function, but it seem to return a non-instanced node.

Like this,

behaviorTreeComponent->GetActiveInstanceIdx(); returns 1.

behaviorTreeComponent->GetActiveNode()->IsInstanced(); returns false.

Can I get a instanced task node?

Hello ykimisaki,

Have you looked at UBTNode? For instanced task nodes please refer to the following API Documentation.

UBTNode

Thanks!

Thank you, NicholasMont.

I tried this code, and I’ve done!

auto activeNode = this->behaviorTreeComponent->GetActiveNode();

auto searchedData = FBehaviorTreeSearchData(*this->behaviorTreeComponent);

auto instancedNode = Cast(activeNode->GetNodeInstance(searchedData));