Cannot find out how to spawn Static Mesh Instance with code

Please help!!

After being unable to do what I need with blueprints, I’ve been bringing my C++ code directly for use in Unreal. I’m done with everything I need to do except for actually spawning the geometry in the world., This is very simple to do with Blueprints, but I can find absolutely no information on spawning instanced static meshes through code.

I have a UStaticMesh * FloorMesh (as one example) that I’m using for my floors, and it doesn’t matter what type of spawning function I try to use, I cannot get anything that will take my FloorMesh and allow me to spawn it into my world.Getting real annoyed here. This is something that should be VERY EASY! So why can I not find any information on how to do it in C++??

I will give you general anwser how to find features you see in Blueprint in to C++, because that seems to be your problem. This knowledge should open your mind for lot of things

95% (maybe even less) nodes you see in blueprint are actual function in C++, they are all binded only via magical word “BlueprintCallable” or “BlueprintPure” and thats it. They usally have have same name but without spaces, some has custom names and you need to find them in github, some are in kismet library (KismetSomethingLibrary, there few of those). You can easily find function via “target” pin, it a special generated pin which inputs on what object function should be called, the type of that pin is a class where function is declered. So for example:

https://docs.unrealengine.com/latest/INT/BlueprintAPI/Utilities/Transformation/SetActorLocation/index.html

Target pin is “Actor” type, so the means this function is from AActor and when we look on AActor API refrence we can see this function:

Note that this function is specially made for blueprint and little diffrent then SetActorLocation, but most functions have same name.

So look up on blueprint you use to make instantiated meshes (SpawnActor is custom node and little diffrent in C++ ()->SpawnActor()) and try find functions that you use

Personally i never did instantiated meshes so i’m not sure how to do it at all, i would need to look it up myself:p