Game Development Reference
In-Depth Information
One general step that you will perform for all blueprints is to set the dynamic material for
them. As you know, you made only one material and applied it to the platform and to the
ball. However, you also want both to look different during the gameplay. Changing the
material color right now will change both objects' visibility. However, changing it during
the gameplay via the construction script and the dynamic material instances feature will
allow you to have many colors for many different objects, but they will still share the
same material.
So, in this step, you will make the platform blueprint and the ball blueprint. I'll explain
how to make it for the ball, and you will perform the same steps to make it for the plat-
form. Select the ball blueprint first and double-click to open the editor; then, this time
navigate to the subeditor graphs to start working with the nodes.
You will see that there are two major tabs inside the graph; one of them is named Con-
struction Script . This unique tab is responsible for the construction of the blueprint itself.
Open the Construction Script tab that always has a Construction Script node by de-
fault; then, drag and drop the StaticMesh component of the ball from the panel on the
left-hand side. This will cause you to have a small context menu that has only two op-
tions: Get and Set . Select Get , and this will add a reference to the static mesh.
Now, drag a line from Construction Script , leave it in an empty space, add a Create Dy-
namic Material Instance node from the context menu, and set its Source Material op-
tion to the material we want to instance (which is the emissive material). However, keep
in mind that if you are using a later version, Epic introduces a more easy way to access the
Create Dynamic Material Instance node by just dragging a line from Static Mesh-ball
inside Graph , and not Construction Script .
Search WWH ::




Custom Search