Setting up the PCG crowd graph
We just reached the final part of this chapter, and we will create a PCG graph that is capable of spawning actor characters across the level. I will show you how to set up a logic system for spawning the actors from the PCG graph:
- Inside your
PCG
folder, right-click and create a new PCG graph, and let’s call itPCG_Crowd
. - Open your graph, and let’s start adding the nodes to the PCG graph! The nodes we are going to add are: Get Actor Data, Spline Sampler, Transform Points, and Spawn Actor. The last node generates and spawns all objects associated with the actor class.
Figure 9.49 – Add Get Actor Data, Spline Sampler, Transform Points, and the Spawn Actor nodes to the PCG graph
- Firstly, connect the Get Actor Data node to Spline Sampler and then Spline Sampler to the Transform Points node.
Figure 9.50 – Connect the nodes
- Select the Spline...