Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

In App Purchasing for my platformer game

Discussion in 'Scripting' started by wjhbrendan, Aug 28, 2016.

  1. wjhbrendan

    wjhbrendan

    Joined:
    Jul 17, 2016
    Posts:
    15
    Hello everybody,

    I'm trying to implement in app purchasing for my game, and i'm not sure if what i'm doing is a good practice or not. Essentially, in my game you collect coins by jumping around, and you cash them out for a different player model/skin in the store. Currently i have the coins stored in a player pref and i'm not sure if this is a good practice because people can delete the file/manipulate it freely. I plan on making it possible to purchase 1000 coins with real money and just adding to that player pref.


    Any ideas?
    Thanks!
     
  2. EETechnology

    EETechnology

    Joined:
    Aug 15, 2015
    Posts:
    185
    Well, theres a couple of things you can do!

    1. You can connect to a database and store the purchases there so everything will be more secure
    2. You can encrypt the file locally, which means that the players cant have access on it easy!
    3. Create your own front end security, which means that when the file is removed, it automatically clears all the purchases and reset coins.

    There is more you can do but those should give you a quick start!
     
  3. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,146
    Don't use playerprefs straight up. I know there are some encryption assets for playerprefs, they may be better, but a plain old playerpref is easy to access for anybody wanting to look on a pc at least. Look into a backend service where a player has to login as well, that makes it easier to also keep track of their purchases and watch for odd behavior.