- Home /
Counter help
var notes : int = 3;
var notesText : GUIText;
function Update () {
notesText.text = "Notes : " + notes;
if(notes == 3) {
if(Input.GetKey(KeyCode.R)) {
Destroy(gameObject);
}}
Hello i need help making a script for my game. I am trying to make a script so that when i player picks up a piece of paper it adds it to the inventory. When the player gets 3 they have the ability to set things on fire by pressing a ceratian key. Then their notes go back to zero. Any help would be appreciated and my preference for a language would be javascript, thanks!
can you provide how you are storing these notes in inventory? generally speaking, if you're going to destroy gameobjects when you click R and you've collected 3, you'll want to store the collected notes in a List<> so you can Destroy them when the time comes. then say notes = 0. I'd provide some sample script, but I don't know how your inventory system works.
I am trying to make an inventory script in the same script as the one i just listed. I haven't created the inventory script yet.
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
trying to get a collection system for a Myst type game 0 Answers
Cant pickup papers with script 2 Answers
Trying to get score counter... 2 Answers
Connecting 2 scripts(javascpt)? 2 Answers