I am interested in assigning static mesh to my static mesh component during runtime, after I receive a string with path to specific mesh from other class. So, in constructor, I just do
then, in the other member function of the class, when I get the FString with correct mesh path (e.g. “StaticMesh’/Game/Shapes/Shape_Pipe_180.Shape_Pipe_180’”), I would like to assign that mesh to my component. The only way I know is this:
Reason: During packaging the above references will be carried over correctly.
Reason2: They’re super easy to change at any time without requiring code compile.
Hardcoding asset paths is bad idea cause they will change during packaging and may not get updated.
My Dynamic Load Object is for when you dont know which mesh to load pre-compile time, but the user picks one in game / you maybe randomly choose from a series of meshes
#Video
Here’s a video of my runtime use case!
In the very beginning, I am clicking on different mesh and using my Dynamic Load Object code above to get the mesh asset to build with
Thanks, man, that works now. However, while in “Simulation” mode I clearly see my mesh, for some reason if I start playing as a player I don’t see it on the map. Do u have any thoughts, why does that happen?
I have flags set in a right way, as far as I understand: