Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: MatiasHarder on August 21, 2017, 12:56:18 PM

Title: Help! Change texts with playmaker
Post by: MatiasHarder on August 21, 2017, 12:56:18 PM
Hello, I would like you to orient me to know how I can change a text of the UI with numbers.

Example 1:
Place a text that appears 1 and every second go up to 100.

Example 2:
Place a text with the number 50 and each second increase 10+.

How can I make it possible?
Title: Re: Help! Change texts with playmaker
Post by: tcmeric on August 21, 2017, 01:23:48 PM
Hi. First you need to setup the numbers.

State 1
1. Wait for x amount of time, ie 1 second. Action: Wait. On finish, go to state 2.

State 2
2. Int variable. Action: Int add.
3. You need to convert the int to a string. Only strings can be displayed. Action: convert int to string.
4. You need to display it. Make a uGUI canvas with some text. Next, to change it with playmaker. From the ecosystem, download the ugui actions package. Then use the action: set ugui text (I think that is the name).
5. Check to see if your number has reached 100 (or 50). Use action: Int compare. If equal or greater than 100 (or 50), then go to a third state (maybe called finished). If less than, go back to state 1.

State 3
Empty state for finish.


Title: Re: Help! Change texts with playmaker
Post by: MatiasHarder on August 21, 2017, 03:40:58 PM
Wow thank you very much :D It helped me a lot