Spawning Health Collectables in Unity | Using Interfaces to Create Flexible Collectable Behaviours @KetraGames
Spawning Health Collectables in Unity | Using Interfaces to Create Flexible Collectable Behaviours  @KetraGames
Uploaded November 2023 | Updated September 2026, 2 weeks ago
In this Unity tutorial we're going to look at how to make the enemies randomly drop health collectables when they’re killed. When the Player walks over the collectable, a portion of their health is then restored.

We'll cover the creation of a base prefab for all collectables, and the creation of a specific variant for the health collectable. We'll make use of C# interfaces to provide a flexible way if defining the collectable behaviour.

This is the sixteenth video in our series showing how to make a full top down 2D shooter game in Unity.

The playlist for this series can be found here
youtube.com/playlist?list=PLx7AKmQhxJFajrXez-0GJgDlKELabQQHT

The project files are available to our patrons here:
patreon.com/posts/93282900

Want to follow along? This project is a good starting point
patreon.com/posts/89775350

The full Top Down Shooter Project is available to our patrons here
patreon.com/posts/75231350

The final script can be found here
dotnetfiddle.net/5Djhjn

The assets used in this video can be found here
assetstore.unity.com/packages/2d/textures-materials/2d-sci-fi-weapons-pack-22679

Help support our work:
► Patreon: patreon.com/ketragames

Follow us:
► Ketra Games: ketra-games.com
► Patreon: patreon.com/ketragames
► Twitter: twitter.com/ketragames
► Facebook: facebook.com/ketragames

Introduction - 0:00
Installing the Assets for the Health Collectable - 00:37
Creating the Base Prefab for the Collectables - 01:30
Creating the Prefab Variant for the Health Collectable - 03:20
Creating the Collectable Script - 04:38
Creating the Health Collectable Behaviour - 06:42
Spawning Collectables When the Enemies Die - 11:29
Summary - 17:25

#KetraGames #LearnUnity #UnityTutorials #UnityTips
Spawning Health Collectables in Unity | Using Interfaces to Create Flexible Collectable BehavioursHow to Collect Items (Unity Tutorial)Local Transform vs World Transform - Whats the Difference?Procedurally Generating a Perfect MazeShow a Silhouette When Hidden Using URP Renderer Features (Unity Tutorial)How to Use Sorting Layers (Unity Tutorial | 2D Top Down Shooter)Improving Ragdoll Physics (Unity Tutorial)👉 Why URP Shadows Look Worse in Unity 6 (And How to Improve Them)Creating Simple Animations (Unity Tutorial)How to Make the Player Shoot (Unity Tutorial | 2D Top Down Shooter)Slow Motion Effect (Unity Tutorial)How to Create 2D Movement Animations in Unity | Animator States and Transitions Explained
Ketra Games |

Spawning Health Collectables in Unity | Using Interfaces to Create Flexible Collectable Behaviours

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER