Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Code for Real Cash Shop

Discussion in 'Scripting' started by NowakSotto, Aug 29, 2019.

  1. NowakSotto

    NowakSotto

    Joined:
    Aug 26, 2019
    Posts:
    10
    Hey guys, im new in Unity, but i have knowledge in programming.

    I start to make a 2d game, sure im in the beginning of it, but we can talk about how to create the cash shop.

    The simple thing i want do is a button where the player go to shop(providing this in the game now), and go have two types of item, the in-game cash and the real money cash, where go have different itens for each type to buy.

    So if someone can start help me talking about the code, explaining how it work and how i can add it to the game.

    If the post is in the wrong place please adm change for me

    Thanks a lot.
     
  2. Vryken

    Vryken

    Joined:
    Jan 23, 2018
    Posts:
    2,106
    You should really focus on making the actual game first.

    I don't mean to offend or assume, but whenever a new user comes in and the first thing they ask is how to implement microtransactions, it really just sets off the "I'm only in it for the money" alarm bells.
     
    Kurt-Dekker likes this.
  3. NowakSotto

    NowakSotto

    Joined:
    Aug 26, 2019
    Posts:
    10
    asked this because i want start study how i go make this and implement this in the game
    what i go need or dont and what go be the good way to make it usefull
     
  4. Sciirof

    Sciirof

    Joined:
    Apr 5, 2013
    Posts:
    14
    As Vryken said focus on making your game first.
    As for the code for it, assuming you mean In-App Purchases:
    https://docs.unity3d.com/Manual/UnityIAP.html read this thoroughly and start coding. IMO asking for code is bad practice, asking for sample code is another thing. But honestly (no offense) if as you said you know how to write code, you should be fine with either the docs or tutorials.
     
  5. NowakSotto

    NowakSotto

    Joined:
    Aug 26, 2019
    Posts:
    10
    Yah, i go stay focused in the create of the game

    sorry if i put the wrong words in the request, im ok with docs and tutorials, i dont mean to "give me the 100% functional code".

    Anyway thanks for the words guys.
     
  6. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Figure out what package, asset, or SDK you're going to use to do real money purchases for your chosen platform. Maybe that is the UnityIAP, maybe it is Steam, maybe you're going to roll your own website with PayPal, no idea what you're planning. Then find tutorials or examples specific to what you have chosen. If it is UnityIAP for example, there is a forum specific to that here you should be looking at.

    Otherwise all anyone can tell you is you'll have some variable with the current value of money in the game, which gets set through some kind of magic, which you subtract from as the player uses it.
     
    Ryiah likes this.