how can i make it so that you can mine something in game and then have a certain number of that material but i only want it to show in one screen that you can bring up by pressing a button example: hydrogen----- 32 units oxygen------- 99 units element 0---- 12 units methane ----- 58 units etc etc i want it so that you can only mine it in a certain spot thanks
1 Answer
1I would really recommend reading the scripting reference in the manual and learning one of the languages Unity uses. The reason I say this is that what you're asking for is as simple as adding to integers and displaying GUI boxes, which is very basic and covered in full (and then some) right in the manual. Since I don't believe you've read the manual, I at least ask you do that before asking others to do the work for you. No offense intended. I'll help you with where to look, though:
Search OnGUI in scripting reference for creating the interface.
For what you asked, you need to learn about strings and integers (and general programming).
You didn't say what language you're trying to use (I'm guessing you don't know yet) or what sort of game you're trying to make, so I don't know what to say about the mining thing. How you go about it will differ on whether you're making an isometric, 3rd person, 1st person, etc. type of game. For a first-person game you might make it based on where you click, for a third person game it might be based on a raycast.
Hopefully you understand why I point you in the right direction rather than writing a script for you; too many people come here asking for script after script, and then they get frustrated later because they can't write scripts themselves, and they subsequently lose interest or feel helpless and quit game making forever.
I'd recommend programming in C# since Microsoft has a very good program with great autocomplete to help you learn quickly (Microsoft Visual Studio C# 2010). Plus I'm pretty sure the majority of our helpers here program in C#, so you'll more quickly get an answer you're looking for (and won't have to translate to a different language).
i don't get it... can you give me a better explenation?
– anon88309842