Name
and Parent
, but since these arenât necessary for our current task, weâll leave them at their default values.
Step 2: Spawning a Mesh
Next, letâs spawn the Party Hat model. Locate the Spawn Mesh node in the Node Library, select it to spawn it into the workspace, and connect its execution pin to the Create Scene Node.
Resource<Mesh>
in the blueprint so that blueprint instances can dynamically specify which model to spawn. Alternatively, we can hardcode the model directly into the node.
Since the only thing we want to change between blueprint instances is the color of the Party Hat, but never the actual model, we will opt to hardcode the mesh selection.
Click the Edit (Pencil) Button next to the Resource
pin and select the PB_Head_PartyHat meshâthe model we imported earlier.
Node
pin from the Create Scene Node and connect it directly into the Parent
pin of the Spawn Mesh Node.
PartyHat
.
At this stage, we should now have a functioning blueprint that spawns a Party Hat into the scene - but how do we know this is true and how can we test this is actually the case? We will need to lean on our previewer to validate we are making steps towards our desired outcome.
0
(which targets the first slot).
Renderer Input Pin
Renderer is the component responsible for taking a mesh and a material and combining them into a final visual result.
Because a mesh may contain multiple renderers, the Spawn Mesh node provides an output pin of type Array<MeshRenderer>
. In our case, the party hat mesh only has one renderer, so we just need to extract the first element from this array.
To do this, we can use an At Index node:
Renderers
output from the Spawn Mesh node into the Array
input of the At Index node.Index
input on the At Index node to 0
(to retrieve the first element).Renderer
input of the Apply Material node.Properties
output of the Make PBR Properties node to the Properties
input of the Material Instance node, then, connect the Material
output of the Material Instance node to the Material
input of the Apply Material node.
T_PB_Head_PartyHat_NR_1024
T_PB_Head_PartyHat_ORM_1024
0.5
.PartyHat-Color
, and assign it a default valueâthis will be the color applied when no other value is specified.
Get PartyHat-Color
node directly to the Base Color input of the PBR Properties node.
This connection ensures that the base color of the material is now determined dynamically at runtime, instead of being permanently set within the blueprint. By changing the value of PartyHat-Color
, we can modify the appearance of the hat without needing to create an entirely new blueprint.