I’m using FObjectFinderOptional
in a construct to find assets that may or may not exist.
Usually with FObjectFinder
a warning is shown when running the editor and an asset is not found, but with FObjectFinderOptional
this should be not shown.
However it’s shown in this case:
UMyAudioSettings::UMyAudioSettings(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
SomeTestCue = TryLoadEvent( "some_test_cue" );
}
USoundCue* UMyAudioSettings::TryLoadEvent( const FString& ShortPath )
{
FString UIRootPath( TEXT( "/Game/Audio/Events/UI" ) );
FString FullPath = FString::Printf( TEXT( "%s/%s.%s" ), *UIRootPath, *ShortPath, *ShortPath );
static ConstructorHelpers::FObjectFinderOptional<USoundCue> EventObject( *FullPath );
return EventObject.Get();
}
Does anyone know why this is happening?