I’ve created an actor in c++ then made a blueprint with that actor as base.
I then edited the blueprint and added some components in the editor.
I’m in c++ attempting to access these components that were added in editor but they always seem to return nullptr. Is it possible to get these components added within the editor or do I need to add them manually in c++ for them to be accessed properly?
I’ve tried a number of suggested methods online including (In the constructor):
//Attempt
TArray<UStaticMeshComponent*> Components;
this->GetComponents<UStaticMeshComponent>(Components);
for( int32 i=0; i<Components.Num(); i++ ) //Count is zero
{
UStaticMeshComponent* StaticMeshComponent = Components[i]; //null
UStaticMesh* StaticMesh = StaticMeshComponent->StaticMesh;
}
Actor in question: