Hey guys.
I’m got stucked with some problem.
I need to get asset bounds.
What I have:
- Asset ref string: “Blueprint’/Game/some_bp’”
What I need to get:
- FVector with actor bounds
Have tried this code, but unfortunately it isn’t working
FVector GetAssetBounds(FString path)
{
FStringAssetReference MyAssetPath(path);
UObject* MyAsset = MyAssetPath.TryLoad();
UBlueprint* spawnObj = Cast<UBlueprint>(MyAsset);
AActor* act = (AActor*)spawnObj->GetClass();
FVector ori, ext;
act->GetActorBounds(true, ori, ext);
return ext;
}