How to get a reference to static mesh component in C++?

Hi, I have a C++ class, and a BP class extending from that.
In the BP class I added a static mesh component.
Now I was wondering what the best way is to get a reference to that staticmesh.

I’ve seen there are some functions like GetComponents that I could use, but I wonder if there is no ‘direct’ way to make the staticmeshcomponent from the BP link to a variable in the C++ class.

Any ideas?

You could just define the component on the C++ class and have the BP set the reference to the specific mesh you want to use. In that way you’ll have access to the component in the C++ class. I also find that this is a better utilisation of Blueprints, i.e. the C++ code creates the “template” and Blueprints are used to set the specific references.