Hi everyone. I did not find the answer on the forum and on the Internet. UE4 does not see the asset, if path is “’/Game/Content/StarterContent/Blueprints/Assets/TestCube.TestCube’” writes in Log:
LogStreaming: Error: Couldn’t find file for package /Game/Content/StarterContent/Blueprints/Assets/TestCube requested by async loading code. NameToLoad: /Game/Content/StarterContent/Blueprints/Assets/TestCube
if path is “’/SGame/TestCube’” (where SGame is really name of project folder) UE4 writes:
LogStreaming: Warning: LoadPackageAsync failed to begin to load a package because the supplied package name was neither a valid long package name nor a filename of a map within a content folder: ‘’ (/SGame/TestCube)
Type of the uploaded asset StaticMesh
.h
FSoftObjectPath PathObject;
.cpp
void ATestLoadActor::BeginPlay()
//The path to be loaded
PathObject = FSoftObjectPath(TEXT("/SGame/TestCube"));
//Create an asset manager
FStreamableManager& AssetLoad = UAssetManager::GetStreamableManager();
//Request asynchronous loading
AssetLoad.RequestAsyncLoad(PathObject, FStreamableDelegate::CreateUObject(this, &ATestLoadActor::CallBack));
void ATestLoadActor::CallBack()
{
TSoftObjectPtr<UStaticMesh> ActorMesh(PathObject);
UStaticMesh* Actor = ActorMesh.Get();
if (Actor)
{
GEngine->AddOnScreenDebugMessage(-1, 3, FColor::Red, Actor->GetName());
}
}