Game Development Reference
In-Depth Information
Building the ball blueprint
Start making the ball blueprint by adding an Actor blueprint in your project directory.
Name it Ball and double-click on it to open the blueprint editor. Then, navigate to the
Components subeditor if you are not ready. Start adding the following components to the
blueprint:
• The sphere will work as the collision surface for the Ball blueprint. So, for this
reason, you will need to set its Collision option to Simulation Generates Hit
Events and Generate Overlap Events to True . Also, set the Collision Preset
option to Block All to act in a manner similar to the walls from the layout blue-
print. You need to set the Sphere Radius option from the Shape section to 26.0
so that it is of a good size that fits the screen's overall size.
• The process for adding static meshes is the same as you did earlier, but this time,
you will need to select a sphere mesh from the standard assets that came with the
project. You will also need to set its material to the project default material you
made earlier in this chapter. Also, after selecting it, you might need to adjust its
Scale to 0.5 in all three axes to fit the collision sphere size. Feel free to move the
static mesh component on the x , y , and z axes till it fits the collision surface.
• The projectile movement component is the most important one for the Ball blue-
print, or perhaps it is the most important one throughout this chapter, as it is the
one responsible for the ball movement and velocity and for its physics behaviors.
After adding the components, you will need to make some tweaks to it to allow it
to give the behavior that matches the game. Keep in mind that any small amount
of change in values or variables will lead you to have a completely different beha-
Search WWH ::




Custom Search