How Do you use a claimed Smart object in c++, I can’t find an example anywhere online.
I currently have everything in place to claim the smart object successfully, but it refuses to run. My AI will not move to the smart object and use it, but it’s only from the c++ function. If i call the BP node it works which i tested by calling an interface function that is simply calling the BP node version.
Help would be fantastic here.
Proof that claim is valid:
if (USmartObjectBlueprintFunctionLibrary::IsValidSmartObjectClaimHandle(Claim))
{
UE_LOG(LogTemp, Warning, TEXT("Smart Object Claimed"));
Interface Function which calls the node in BP and it runs.
/* Test for valid claim using Interface. This runs fine
if (ContextActor->GetClass()->ImplementsInterface(UBPI_NPCDynamicAI::StaticClass()))
{
UE_LOG(LogTemp, Warning, TEXT("Running Interface")); IBPI_NPCDynamicAI::Execute_RunClaimedEvent(ContextActor, Claim);
}
*/
The actual code that doesn’t work:
UAITask_UseGameplayBehaviorSmartObject::UseClaimedGameplayBehaviorSmartObject(Controller, Claim, true);
//These don't work either
//UAITask_UseGameplayBehaviorSmartObject* Task;
//Task->UseClaimedGameplayBehaviorSmartObject(Controller, Claim, true);