hi forum i have a issue with this
i have a class to instance a UStaticMeshComponent* and loads a mesh inside; editor works perfect but in package dont work
i evalute with FStringAssetReference i have no NULL mesh but dont display nothing, is this a bug?
this is my sample code of the constructor
AMyPawn::AMyPawn()
{
pivotComponent = CreateDefaultSubobject<USceneComponent>("Pivot");
RootComponent = pivotComponent;
plane= CreateDefaultSubobject<UStaticMeshComponent>("Plane");
#define LM_ASSETS_FOLDER TEXT("/Meshes")
UStaticMesh* planeMesh = ConstructorHelpers::FObjectFinder<UStaticMesh>(LM_ASSETS_FOLDER TEXT("/Plane")).Object;
if (plane != NULL)
{
Plane->SetStaticMesh(planeMesh );
//y = width, z = height
Plane->SetRelativeScale3D(FVector(1, 640, 480));
Plane->SetRelativeLocation(FVector(660, 0, 0));
}
}
and now in the begin play i find them
void AMyPawn::BeginPlay()
{
Super::BeginPlay();
FStringAssetReference thePath = FStringAssetReference(Plane->StaticMesh);
if (!thePath.IsValid())
{
GEngine->AddOnScreenDebugMessage(-1, 10, FColor::Red, thePath.ToString());
}
}
is working and print the right path in package but is loading nothing! what is wrong here? i am overhelmet with this