playMaker

Author Topic: Score  (Read 3663 times)

JayHaz86

  • Playmaker Newbie
  • *
  • Posts: 8
Score
« on: January 20, 2015, 07:36:19 AM »
Hey Playmakers,

I was following a youtube tutorial for adding score on the scene. However, something went wrong and could not possibly get it to work. What I need is that the player collect coins, and upon collecting his coins will increase and once he dies it will show on the gameover screen how much he has earned.

example: (screenshot added)

Please share your knowledge in full as I have little knowledge in Playmaker.


Yours, Jay

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Score
« Reply #1 on: January 20, 2015, 07:48:05 AM »
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

JayHaz86

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Score
« Reply #2 on: January 20, 2015, 08:40:41 AM »
Hey Lane, Thanks, I will try it out today and get back to you. :)

JayHaz86

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Score
« Reply #3 on: January 20, 2015, 04:00:15 PM »
Hey Lane, I followed the tutorial and it matches the tutorial I followed before. Anyway, I did everything but it seems that I am missing something which did not let the coin to get added to the screen.

please find below the screen shots of the manager and the coin

Here is what I did in short (keeping in mind I added the variables as given in the tutorial):

1- Added the manager as given in the screenshot
2- Added GUI Text by adding new UI which will include Canvas, and then I click add component and added GUI Text
3- Added the coin state.


everything works fine when I run the game, but in development it gives me an error which says "Owner needs a Collider/RigidBody to respond to collision/trigger events!" coin: FSM Idle.

Please note that I added Circle Collider 2d but still nothing gets added!

Thanks.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Score
« Reply #4 on: January 20, 2015, 04:06:40 PM »
If you're using the 2D Sprite system then you need to use the corresponding actions for 2D systems, the collider and physics components are completely different and don't work with 3d physics system and actions. Stuff like Collision 2d Event, Trigger 2d Event, Add Force 2d, etc.

https://hutonggames.fogbugz.com/default.asp?W1150

Also, states are run top-to-bottom, so you have to convert the int to a string before setting the GUI Text. Else.. Well.. There is an empty string being put into the text field.
« Last Edit: January 20, 2015, 04:08:33 PM by Lane »
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

JayHaz86

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Score
« Reply #5 on: January 20, 2015, 05:00:27 PM »
Hi Lane,

Thanks for keeping up with me.

Indeed I am using 2d package  I am not mixing anything.

The other point, I converted the int to string following the tutorial, and if you check the screenshot I put you can see that I did the same.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Score
« Reply #6 on: January 20, 2015, 05:03:57 PM »
Yes, but the string must be updated before it is put into the GUI Text, otherwise with the top-to-bottom state flow it will first update the GUI Text with old, or blank information, then update the string variable but never use it.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D