C++ created static mesh component not the same as Blueprint created

I’m creating my own AActor class in C++ and I want to be able to add a blank static mesh component so I can make Blueprints off it and easily choose which mesh I need. My issue is that adding a static mesh component via C++ seems to leave me with a completely different details panel than adding it with blueprint.

When I add via blueprint, I get this:

With this I can easily set the material of the object.

When I add via c++, I get this:

It gives me a drop down for choosing a bunch of different components and I can’t seem to be able to change the material at all with this method.

I was following the documentation for Player Input and Pawns. It says how to add a component to the scene. In that, the static mesh added seems to have the same details panel as in my first picture but mine ends up like in my second picture. Am I just doing something wrong here? How can I add a scene component via C++ but have the same details panel as one added via blueprint?

Can you show us your .h and .cpp?

I’ve since tried a new direction after not being able to get this to work so I went to recreate my issue. I made a new pawn class and it’s exactly the same as the example code here on this page: https://docs.unrealengine.com/latest/INT/Programming/Tutorials/PlayerInput/1/index.html

If I drag my C++ pawn into the world and look at it in the map editor, the details panel is how I expect it to be. If I create a blueprint class off my C++ pawn and drag that into the world, the details pane is how I expect it to be. It’s just when I edit it in the blueprint editor, the details pane in there gives me that weird drop down menu where I can select a bunch of different scene components.

hey guy,
the same question as u ,have u solve it?

Yeah, you have to use the UPROPERTY() macro in the header. I’m using something like this:

UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
class USceneComponent* = whatever;