Chests and health potions

Greetings, adventurer!

Today, I will write a little post about chests that you can find around in the maps and in the caves. When you open the chest, you will find a health potion that you can take with you and use whenever you want.

First, we need to create the health potion prefab which is a Gameobject with a Sprite Renderer, a Box collider and a script which gives the player an health potion.

Next, we need to create the Chest prefab. To create the Chest, we start with an empty GameObject, and add Sprite Renderer, Box collider and one script. The script takes two sprites, one for un-open and one for open chest which changes after you have opened the chest. The script also takes the health potion prefab which it spawns upon the chest when opened.

2015-12-12 (1)


Best regards

P219 Development Team



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s