I have a class that inherits from APawn, and the class is used in the Blueprint Graph Editor. How would I create a class member that would reference another component in the Blueprint?
Basically, several components are added together to create the final object. Now I need to reference different parts of the object via C++. I can’t seem to get this to work with:
TAssetPtr<AActor> myVar; AActor* myVar; TAssetPtr<UStaticMeshComponent> myVar; UStaticMeshComponent* myVar;
because the components are Static Mesh Components. I can assemble components in the Graph Editor Viewport but the components added are not considered Actors. Additionally, components could span the gamut, and I would like a more robust and generic solution if one exists.
When using UUserWidget I have used WidgetTree and searched for a hardcoded name, something I don’t like, but if possible, I’d like to use a class member to point to the object that needs to be manipulated.
Can someone help?