- Home /
Let Game-Building finish over time / Gold increment over time
Hi!
You surely know these kind of games, where you build some building, and it takes - say - 12 hours and 30 minutes to build.
What is the best possible way of accomplishing that? Would I have to save the necessary vars into playerPrefs before the player leaves the game and reload them when he enters, then do some calculations based on that, or is there something way easier?
Bonus Question: My game is also Multiplayer with the help of Player.IO. I'd like to make this aspect of the game relatively hack proof. So I was thinking about using the Player.IO SQL Database, good/bad idea?
Coding in C#
Thanks!
The easiest and also hackproof way to do this, is to work with the time of your server. When you start building, get the server time, add your 12 hours to it and save this as finish time. If this time is still ahead, let it print out "Buildin will finish in xx" or something. When it is past this time start your finish building routine. This is more hacksave since playerprefs and local time can be easily edited.
Your answer
Follow this Question
Related Questions
Flip over an object (smooth transition) 3 Answers
"Change" Prefab Component Attributes 0 Answers
Permanent Variable Change in Editor 3 Answers
Save works for computer but not once i create the build and load it on the android 1 Answer
How to create prefab from a GameObject variable in class? 0 Answers