I have followed the Smart Objects Quick Start tutorial and for the most part it works. However if I exit the simulation after the “Use Claimed Gameplay Behavior Smart Object” node is called and before it completes the editor crashes. If I end the simulation at any other time there is no issue, it’s specifically while the Use Claimed Gameplay Behavior Smart Object node is navigating my AI Actor to a Smart Object.
When the crash occurs the top of the stack trace is:
That line in question is calling a check() function on OwnerController->GetPawn(). I’m assuming the check() function is just an assertion that the input is not null - can anyone tell me whether that assumption is correct?
If so, what then? The controller input to that node is the Owner Controller passed in by the Event Receive Execute AI. I’m not sure there should necessarily be an expectation that the owner controller has a Pawn?
My guess is that there’s something amiss in the configuration of the AI Controller, and I assume that gets configured under the hood by the various Blueprint Classes etc I created during the tutorial. If anyone has any insight into exactly what the GetPawn() is supposed to be referring to and how that relates to my resources I’d appreciate the help.
Hey,
I had exacly the same error. The problem is the callback “OnSlotInvalidated”
seems that if it gets called on game destruction the pawn doesn’t exist anymore.
void UAITask_UseGameplayBehaviorSmartObject::OnSlotInvalidated(const FSmartObjectClaimHandle& ClaimHandle, ESmartObjectSlotState State)
{
// these two lines do the trick. Maybe there is a smarter way ;)
if(OwnerController == nullptr) return;
if(OwnerController->GetPawn() == nullptr) return;
Abort();
EndTask();
}
Hi, I just had the same issue when I switched unreal version from 5.1 to 5.2. What helped was Reloading all AI-related assets. After that I had to fix some cached things and it started working again.
Go to Epic Games\UE_5.2\Engine\Plugins\Runtime and move the “GameplayBehaviorSmartObjects” to your Plugins project folder.
If you don’t have the Plugins folder, create one in the project root folder.
Go to GameplayBehaviorSmartObjectsModule\Private\AI\AITask_UseGameplayBehaviorSmartObject.cpp - UAITask_UseGameplayBehaviorSmartObject::Abort, comment out check(OwnerController->GetPawn()); and add if (OwnerController->GetPawn()) check before the AbortBehavior.
In case the problem still persists, check your Build.cs and remove “GameplayBehaviorSmartObjectsModule” from the PublicDependencyModuleNames.
With these changes your project should use the custom plugin from the project Plugins folder and the plugin will no longer crash the editor on game stop. However, in case of the plugin updates you have to update it manually until they fix the issue.
It is probably still taking the plugin from the engine folder. Make sure it uses the one in your project. You can even try deleting it from the engine folder to be sure. The error should not happen then. Build.cs could stay as it is.
Just ran into this problem as well. Verified that the plugin is in fact listed in the “PROJECT” node of the plugin list within the editor. Error happens on the same line number, a line that is commented out. So clearly its not using my plugin and using a cache maybe?
Hmmm, I was using a BluePrint project. Make sure you go to “Tools” - “New C++ Class” and create a new dummy file. This will enable C++ for your project. Restart, then it will work and your local plugin will be used.