Game Development Reference
In-Depth Information
Next, drop a sphere; you can leave it as is, but I have put a material on it with a red
diffuse color. Now drop the
itemSelf
script on it. These are the values that I have
given to it:
• First Person Controller on the player slot
•
Amount
is set to
25
•
Value
is set to
30
•
Armor Amount
is set to
0
•
Weight
is set to
1
•
Name
is set to
Potion
•
Stat
is set to
Health
•
Self Action
is set to
ChangeHP
•
Self Type
is set to
Potion
Create a new prefab and name it
Potion
; now drop the sphere that you created on
the prefab. You now have a prefab for health potions! Place two of these onto the
map. Currently, you can't do anything with these potions, but later we will let the play-
er pick them up.