So my cpp component is part of a plugin module that is loaded in the pre-default phase. This is because i actually had problems with this same plugin specifically having every reference to it disappearing in my blueprints every time i loaded the project. For some reason, the blueprints must have been loading before the cpp class was loaded and ended up with an empty reference. But now, pushing it to the predefault phase, it breaks the OnPerceptionUpdated and OnTargetPerceptionUpdated event bindings in blueprints and CurrentlyPerceivedActors never updates, its always empty.
Part of my log looks like this:
LogOutputDevice: Error: === Handled ensure: ===
LogOutputDevice: Error: Ensure condition failed: MyOwnerWorld [File:./Runtime/Engine/Private/Components/ActorComponent.cpp] [Line: 1528]
LogOutputDevice: Error: Stack:
LogOutputDevice: Error: [Callstack] 0x1bcb0ed8 UnrealEditor-Engine.dylib!UActorComponent::RegisterComponent() (.cold.1) [UnknownFile])
LogOutputDevice: Error: [Callstack] 0x19d3e960 UnrealEditor-Engine.dylib!UActorComponent::RegisterComponent() [UnknownFile])
LogOutputDevice: Error: [Callstack] 0xf3ce6e88 UnrealEditor-Multibrain-0004.dylib!UDynamicPerceptionComponent::UDynamicPerceptionComponent() [UnknownFile])
LogOutputDevice: Error: [Callstack] 0x0578534c UnrealEditor-CoreUObject.dylib!UClass::CreateDefaultObject() [UnknownFile])
LogOutputDevice: Error: [Callstack] 0x05788708 UnrealEditor-CoreUObject.dylib!UClass::InternalCreateDefaultObjectWrapper() const [UnknownFile])
LogOutputDevice: Error: [Callstack] 0x05b4c2f4 UnrealEditor-CoreUObject.dylib!ProcessNewlyLoadedUObjects(FName, bool) [UnknownFile])
LogOutputDevice: Error: [Callstack] 0x05b90064 UnrealEditor-CoreUObject.dylib!TBaseStaticDelegateInstance<void (FName, bool), FDefaultDelegateUserPolicy>::ExecuteIfSafe(FName, bool) const [UnknownFile])
LogOutputDevice: Error: [Callstack] 0x06de879c UnrealEditor-Core.dylib!void TMulticastDelegateBase<FDefaultDelegateUserPolicy>::Broadcast<IBaseDelegateInstance<void (FName, bool), FDefaultDelegateUserPolicy>, FName, bool>(FName, bool) const [UnknownFile])
LogOutputDevice: Error: [Callstack] 0x07125838 UnrealEditor-Core.dylib!FModuleManager::LoadModuleWithFailureReason(FName, EModuleLoadResult&, ELoadModuleFlags) [UnknownFile])
LogOutputDevice: Error: [Callstack] 0x03684038 UnrealEditor-Projects.dylib!FModuleDescriptor::LoadModulesForPhase(ELoadingPhase::Type, TArray<FModuleDescriptor, TSizedDefaultAllocator<32>> const&, TMap<FName, EModuleLoadResult, FDefaultSetAllocator, TDefaultMapHashableKeyFuncs<FName, EModuleLoadResult, false>>&) [UnknownFile])
LogOutputDevice: Error: [Callstack] 0x036a2070 UnrealEditor-Projects.dylib!FPluginManager::TryLoadModulesForPlugin(FPlugin const&, ELoadingPhase::Type) const [UnknownFile])
LogOutputDevice: Error: [Callstack] 0x036a4c34 UnrealEditor-Projects.dylib!FPluginManager::LoadModulesForEnabledPlugins(ELoadingPhase::Type) [UnknownFile])
LogOutputDevice: Error: [Callstack] 0x02fa8ae4 UnrealEditor!FEngineLoop::LoadStartupModules() [UnknownFile])
LogOutputDevice: Error: [Callstack] 0x02fa5670 UnrealEditor!FEngineLoop::PreInitPostStartupScreen(char16_t const*) [UnknownFile])
LogOutputDevice: Error: [Callstack] 0x02f95f6c UnrealEditor!GuardedMain(char16_t const*) [UnknownFile])
LogOutputDevice: Error: [Callstack] 0x02facd64 UnrealEditor!-[UEAppDelegate runGameThread:] [UnknownFile])
LogOutputDevice: Error: [Callstack] 0x06f71b94 UnrealEditor-Core.dylib!-[FCocoaGameThread main] [UnknownFile])
LogOutputDevice: Error: [Callstack] 0x8895c520 Foundation!__NSThread__start__() [UnknownFile])
LogOutputDevice: Error: [Callstack] 0x87752f94 libsystem_pthread.dylib!_pthread_start() [UnknownFile])
LogOutputDevice: Error: [Callstack] 0x8774dd34 libsystem_pthread.dylib!thread_start() [UnknownFile])
And then i have a bit about it already being registered after that. So it seems like it is registering too early, before MyOwnerWorld exists, failing silently, and then trying to register again when the component is actually added. I’ve done what i can to try to keep it from being loaded before runtime, including eliminating all references to it and only adding it dynamically to a separate dummy actor using Add Component by Class, nothing seems to be working. Anyone else make a class that inherits from AI Perception Component and run into the same issue?