Convert array of Static Mesh objects to array of HISMs

Trying to convert an array of Static Mesh objects to an array of HISMs.

Can any Blueprint experts tell me in the attached, is the Set Static Mesh component accomplishing this task with a single Static Mesh (My Static Mesh)?


You don’t need an array of HISMs, you only need one HISM to accommodate all of your static mesh objects, unless they are very spread out throughout the level, if so, you could divide into a small number of HISMs.

But the starting point of what you want to do is:

  1. Yes, set the static mesh on the HISM to the one that all of your other static mesh objects are using.

  2. Then, loop through all of your static mesh objects / actors, and in the HISM actor , you want to use GetTransform (World Transform) on each Static Mesh Object, and pass that into HISM using

:zap: AddWorldInstanceWorldSpace :zap:

/** Add an instance to this component. Transform is given in world space. */
	UFUNCTION(BlueprintCallable, Category = "Components|InstancedStaticMesh")
	int32 AddInstanceWorldSpace(const FTransform& WorldTransform);

Happy Note: I was the one who facilitated this node getting added to UE4 back in the early release days, for the very reason that if the Static Mesh Objects are not part of the same actor as your HISM, it is much easier to get the world transform of the Static Mesh Actor and use the function above than to try and convert into relative space of the actor owning the HISM.



PS: Highly related video, Red Blood Cell Galaxy:

This was around the time I realized I really wanted an AddInstanceWorldSpace, to coordinate the movement of all these separate static mesh objects, as one unit: