How To Create A Collectable Medkit That Restores Your Player’s Health

Did your player get damaged? Are they struggling to survive and just want a little bit more health to help them overcome that last big obstacle in your level? Well, you’ve come to the right place! Here at “Adam’s Fantastic Medical Emporium Of Totally Not Illegal Supplies!” we offer all the best medical grade recovery items that you can’t tell your mom you took. Now with only half the side effects AND 40% more Kocaine!!!

So the bright side of this is that it’s going to take you less work to implement this feature into your game than it did for “Adam’s Fantastic Medical Emporium Of Totally Not Illegal Supplies!” to come back from that last class action lawsuit.

[NOTE]

Don’t try to sell Kocaine on Amazon…

So all you have to do is create a new game object in your hierarchy and attach a trigger collider and a script that contains the code seen below. Now you have a collectible game object which you can use as a medkit or whatever in order to restore your player’s health in the game.

And voila!…

--

--

--

Hi, my name is Adam Reed and I am a software engineer specializing in Unity and C# development. Feel free to scroll through and check out some of my work!

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

AI learns to fly (Part 1) | Airplane simulation and Reinforcement Learning

First blog post: Strings vs. Symbols

GIT enhanced with TIG

The Finish Line!!

Birthday Cake Candles Solution in Kotlin — Hackerrank

Onboarding Exercise

An introduction to proxy cache server — nuster

IoT — Cloud Computing

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adam Reed

Adam Reed

Hi, my name is Adam Reed and I am a software engineer specializing in Unity and C# development. Feel free to scroll through and check out some of my work!

More from Medium

Making Moving Platforms In A Unity Platformer

A new Architectural pattern for Unity

Make those scripts talk it out!

Mastering Unity Scripting | Summary — Chapter 2: Debugging