I have created a custom class that derives from “UStaticMeshComponent” and adds some “controll”-features
and a MaterialInstance (Its a light, that can be turned on and off)
Everything compiles
If i try to move the class from the ContentBrowser (Source Folder) to my Blueprint-Actor it wont add an object of the class to the actor,
there is no “red cross” or anything else, that would tell me, that im not allowed to add it, so it seems like a bug for me.
Is it not allowed to add a StaticMeshComponent derived class to a BP actor or am I missing something else?
Within your Blueprint Actor class you need to ‘Add Component’ and then select ‘Static Mesh’. After that on the right hand side there will be a static mesh drop down menu and a green box with ‘none’ written inside it. Click on that and select the static mesh you want to add.
That would be fine if i wanted to add a blank StaticMeshComponent, but I want my custom class, that inherits from UStaticMeshComponent, see the code I posted above
That then allows for the Component to appear in the editor.
If you’re wanting any of your functions to be usable in the Editor via Blueprints, you’ll need to make sure you use the UFUNCTION() macro.
And I would recommend still adding a UPROPERTY() macro ahead of your UMaterialInstanceDynamic declaration, just in case it doesn’t get GC’d out from under you! You can use it with no params, so it’ll be included in UBT, but not visible/editable in BPs.
Works great, thank you very much, but I still feel like Unreal could indicate such things a little bit more, because there was no feedback when I moved it from the content browser,