Convert items into Coins / Points! Help. :(

So, here’s the thing. The game that I’m currently developing is about collecting items and then converting them into points.

For example, I got Bags A, B and C
Items should be placed on the correct bag by drag and drop.

Example of an item: Cellphone. should be place in Bag B, and the item(Cellphone’s value is 5). How can the game convert the cellphone into 5 coins? Anyone help about the script for it? It would help a lot.

Thanks a bunch! :slight_smile:

Have an object that is always in the scene with a script attached and give it a tag of ‘player’.

Inside the script (I will call this script guiscript) put:

var coins = 0;

function OnGUI(){

GUI.Label(Rect (10, 10, 100, 20), "coins: " + coins);

}

and inside the script that detects the phone scoring put:

// if the phone is placed{

GameObject.FindWithTag("player").GetComponent(guiscript).coins + 5;

}