Section 3.5. Adding Managed Instances

The first type in Instance we’ll go over are the Managed Instances. These are associated with your Actor and are cleaned up when removed or hidden and built when constructed or changed.

rdActor maintains a Map of StaticMeshes and their desired Instance Transforms and details such as their Folder and Randomization settings. These are turned into real Instances at the appropriate times.

So all we have to do is add the Instance Information we want to that Map. There are some Utility Methods built-in to make that easy.

The First just adds a single Instance to the list with it’s transform:

The next Utility method adds an Array of Static meshes combined with an Array of Transforms. These are parsed into Static meshes and added to the Instance List. You can just add as many Instances to those Arrays.

If you’re working with rdBPtools – it automatically converts StaticMesh Actors into Instanced Static Meshes using these routines – it can make the whole process of building assets extremely quick and easy, not to mention much more powerful than a static scene.