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

Five intresting python libraries must play around with.

How to Eliminate Try-catch Blocks in Java Lambdas

Blocks

Searching for code on Stack Overflow makes you a bad developer?

How to set up MetaMask for Polygon

[Study][Python] lambda

Ownly Market Update: Version 4.0.0 Features

Opt ERP Software for Manufacturing Business | Valiantsystems

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

Day 7: The Enemy

Tap & Hold & Rapid Prototyping w/ New Unity Input System

Cleaning up the Homing Missile code

Starting to feel like a real game