How do I make my player get a score and deduct it when paying for an object like in call of duty
You’re really asking about a few different tasks:
- You’ll probably want some variable to keep track of score. Probably an int or float.
- You’ll probably want to keep that variable in a script, probably a
MonoBehaviour
. - You’ll probably want to attach that script to your player object.
- You’ll probably need some mechanism to change the score.
- You’ll probably need some mechanism to give the player equipment.
- You’ll probably want some mechanism to display the player’s current score (GUI/HUD).
For an experienced developer, most of these tasks will be obvious. It sounds like you’re just getting started, so I’m spelling it out in a little more detail.
Judging from your question, you may want to search the net for Unity tutorials, or for introductions to programming concepts in general. I don’t know of any especially good ones off the top of my head, but the best I can of right now are these two:
- Scripting reference overview (lots of text, can pretty much be your Unity programming Bible)
- Creating gameplay manual section