playMaker

Author Topic: Creating an in-game currency system  (Read 2426 times)

Seiryu33

  • Full Member
  • ***
  • Posts: 133
Creating an in-game currency system
« on: May 14, 2015, 03:54:56 PM »
This might tie into the same process for creating a Scoring system, but how do I use to make a currency counter?  The tutorials I've found have been for 3d games so I'm not sure if it'll work for 2d games. I've tried making one, but when i hit play it floats off screen when the character moves. Creating Text in Unity 5 requires adding it as a component, but for whatever reason it doesn't stay on screen. Am I missing a step?

createasaurus

  • Full Member
  • ***
  • Posts: 146
Re: Creating an in-game currency system
« Reply #1 on: May 14, 2015, 04:31:12 PM »
If the "currency" is floating away... Maybe your currency is stationary, and your camera is linked to the player.  If this is so, link the currency to the camera also, so the currency will follow along when the player and camera move.

Seiryu33

  • Full Member
  • ***
  • Posts: 133
Re: Creating an in-game currency system
« Reply #2 on: May 14, 2015, 07:11:45 PM »
My issue is that the counter itself moves. My basic approach is to make a currency system smiliar to Mario but actually having a purpose. I got as far as doing the basic setup, but the counter itself floats off screen. I've done as it was shown in the tutorials so i'm lost.

Seiryu33

  • Full Member
  • ***
  • Posts: 133
Re: Creating an in-game currency system
« Reply #3 on: May 17, 2015, 01:22:26 AM »
Well, I fixed one problem, now I have another. I created my counter by attaching a GuiText component to an empty object, which seems to be the best way to handle it. The counter moves when I want to, but it doesn't update. My basic setup is to put an Int Add action on the initial state, then link it to a state with a  Set GuiText and a Convert Int to String action.  I then set a Trigger2dEvent to the object in question, in this case a coin, with a Send Event action.   That part went eithout a hitch. But when I run it to test it, the score doesn't update. Instead I get an "Animator not initialized" error. I've redone it several times and gotten the same error. How do I fix it?
« Last Edit: May 17, 2015, 01:26:47 AM by Seiryu33 »