rdBPtools Tutorial 5.3 – Changing/Animating Prefab Objects at runtime.


In rdBPtools version 1.46, some new features have been added.

The first is an “ID” for each object in the prefab – these can be set from the “Randomization Settings” window, or by simply adding a tag to a level actor with “rdID=” and a string ID.

These IDs can be used to find your objects in the prefab. You can call multiple objects the same ID, all will be referenced when using the new functions.

There was already a name stored with each object – the original name of the actor in the level, you can reference your prefab objects with this too (prefix the ID with a “:”).


The following new functions have been added (all in the “By Name” category):

The “Name” can be a collection of Names/IDs, delimited by commas (,). If the Name starts with a colon (:) it references the objects Name, otherwise it references the ID. You can also add an “*” at the end of the name/id to wild-card the search.


This tutorial will step through creating a prefab with named IDs and setting up interactive spheres and cubes to hide/show/move/change CustomData/animate objects in prefabs. You can find a more substantial example using the rdInst version of these Nodes here: rdInst Tutorial 4.2: Working With Prefabs.


Step 1. Create the objects for the Prefab

The first step is to lay out our spheres in the level and set them up ready to animate in the prefab.

Create a new Basic Level and place 4 spheres, side-by-side and 4 cubes, side-by-side in the level:

Now create a new Material, and set it up like below – this caters to both Component Custom Data and Per-Instance Custom Data. Make sure to tick “Use Custom Primitive Data” in the “Param” Node.

Note: It’s not possible to assign Per-Instance CustomData from Blueprint, so for this tutorial we’ll use StaticMeshes – you can use ISMs for everything but the customdata though. rdInst supports the per-instance customdata.

Set this material to each shape you’ve added to the level, and add CustomData to those shapes in the details panel:


Step 2. Set their IDs

Now for each of the shapes, right-click and select “rdBPtools->Randomization->Randomize Settings”. You can also use the “rdInst->Randomize Settings” option, both do the same thing.

Now enter your IDs. For each of the cubes, make the first ID “Cube” then a comma (,) and then the first one “Viz”, the second one “Move”, third one “Anim” and the fourth “Shade”.

Do the same for the Spheres, just make the first ID “Sphere”, then the second ID the same 4 and for the Cubes.


Step 3. Make the Prefab

Now select all the shapes, right-click and select “rdBPtools->Prefabs->Create From Selection”

Untick “Create Instances” and tick “Use StaticMeshes” – this is so we can use the CustomPrimitiveData.

You may need to add the CustomData values to the SMs in the prefab – just select them all and add in the same way as from the level.


Step 4. Add Code to Trigger the changes

Now, in the Blueprint Editor – create some new functions, and tick “Callable from Editor” for each one, make:

  • Hide Cubes
  • Show Cubes
  • Hide Spheres
  • Show Spheres
  • Move Shapes
  • Animate Shapes
  • Shade Shapes


Step 5. Done, Test by running