Setting up collection logic

To create a collectible item, we first want to start a new Blueprint that will determine the properties of each instance of that object that appears in the world. To do so, navigate to the Content Browser and open the Blueprints folder. Add a new Blueprint class, choose the Actor class type, and name it AmmoPickup. Once the Blueprint is made, double-click on AmmoPickup to open the Blueprint Editor.

In the Viewport window that appears, we will see a simple white sphere. This is the default appearance given to empty Actor objects before a Mesh has been applied. To give the object a visible shape in the game, we first need to add a Static Mesh Component to the Blueprint. Find the Components panel, click Add Component ...

Get Blueprints Visual Scripting for Unreal Engine - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.