Description

Adding the Precondition to the SmartObject caused an assertion when it was part of a persistent collection. The precondition needs to be able to pass its Activate method to cause the assert.

This behavior is not observed when the SmartObject is registered at runtime.

Steps to Reproduce
  1. Create an Actor blueprint, add a SmartObject component, tick “Can be Part of Collection”.
  2. Create a SmartObjectDefinition and set the Smart Object Component’s reference to it.
  3. Add a Precondition for “Match Runtime Object Tags”.
  4. Add a slot and a default behaviour and select any valid behaviour class.
  5. Setup the behavior class with animation montage or other data it needs to properly compile and pass validation.
  6. Create an empty level, drag in the BP.
  7. Add a SmartObjectPersistentCollection and click Rebuild Collection.
  8. Start PIE.
  9. Exit PIE.

Expected Result: The editor stops PIE and returns to normal editor workflow.

Actual Result: Editor crashes.

Callstack

UnrealEditor_WorldConditions!FWorldConditionContext::Deactivate() [E:\UE_5.3\Engine\Plugins\Runtime\WorldConditions\Source\WorldConditions\Private\WorldConditionContext.cpp:127]
UnrealEditor_WorldConditions!FWorldConditionQueryState::~FWorldConditionQueryState() [E:\UE_5.3\Engine\Plugins\Runtime\WorldConditions\Source\WorldConditions\Private\WorldConditionQuery.cpp:74]
UnrealEditor_SmartObjectsModule!TSet<TTuple<FSmartObjectHandle,FSmartObjectRuntime>,TDefaultMapHashableKeyFuncs<FSmartObjectHandle,FSmartObjectRuntime,0>,FDefaultSetAllocator>::RemoveByIndex() [E:\UE_5.3\Engine\Source\Runtime\Core\Public\Containers\Set.h:878]
UnrealEditor_SmartObjectsModule!USmartObjectSubsystem::UnregisterCollection() [E:\UE_5.3\Engine\Plugins\Runtime\SmartObjects\Source\SmartObjectsModule\Private\SmartObjectSubsystem.cpp:2121]
UnrealEditor_SmartObjectsModule!ASmartObjectPersistentCollection::UnregisterWithSubsystem() [E:\UE_5.3\Engine\Plugins\Runtime\SmartObjects\Source\SmartObjectsModule\Private\SmartObjectPersistentCollection.cpp:603]
UnrealEditor_SmartObjectsModule!ASmartObjectPersistentCollection::EndPlay() [E:\UE_5.3\Engine\Plugins\Runtime\SmartObjects\Source\SmartObjectsModule\Private\SmartObjectPersistentCollection.cpp:518]
UnrealEditor_Engine!AActor::RouteEndPlay() [E:\UE_5.3\Engine\Source\Runtime\Engine\Private\Actor.cpp:2716]
UnrealEditor_UnrealEd!UEditorEngine::TeardownPlaySession() [E:\UE_5.3\Engine\Source\Editor\UnrealEd\Private\PlayLevel.cpp:856]
UnrealEditor_UnrealEd!UEditorEngine::EndPlayMap() [E:\UE_5.3\Engine\Source\Editor\UnrealEd\Private\PlayLevel.cpp:343]
UnrealEditor_UnrealEd!UEditorEngine::Tick() [E:\UE_5.3\Engine\Source\Editor\UnrealEd\Private\EditorEngine.cpp:2244]
UnrealEditor_UnrealEd!UUnrealEdEngine::Tick() [E:\UE_5.3\Engine\Source\Editor\UnrealEd\Private\UnrealEdEngine.cpp:531]
UnrealEditor!FEngineLoop::Tick() [E:\UE_5.3\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:5825]
UnrealEditor!GuardedMain() [E:\UE_5.3\Engine\Source\Runtime\Launch\Private\Launch.cpp:188]
UnrealEditor!GuardedMainWrapper() [E:\UE_5.3\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:118]
UnrealEditor!LaunchWindowsStartup() [E:\UE_5.3\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:258]
UnrealEditor!WinMain() [E:\UE_5.3\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:298]
UnrealEditor!__scrt_common_main_seh() [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
kernel32
ntdll

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-196645 in the post.

1
Login to Vote

Cannot Reproduce
ComponentUE - AI - SmartObject
Affects Versions5.3
Target Fix5.4
CreatedSep 26, 2023
ResolvedOct 4, 2023
UpdatedOct 4, 2023
View Jira Issue