Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Dood on June 14, 2019, 06:13:27 PM

Title: Help creating iteration with a button[SOLVED]
Post by: Dood on June 14, 2019, 06:13:27 PM
Hello,
How do I make a button in my game that allows the user to perform different actions based on the number of times it was pressed?

Example:
If I press the button once I get an animation of a particular object... If I press the same button again, I get another animation of a different object... And so on...

Is this possible? and how?

Thank you for your time everyone!! 8)
Title: Re: Help creating iteration with a button
Post by: djaydino on June 14, 2019, 07:47:36 PM
Hi.
you can have a int variable and on button clicked do 'int add'
Then you can probably use an array to hold the different animations.

Here is a video about arrays :

Title: Re: Help creating iteration with a button
Post by: Dood on June 15, 2019, 08:58:43 AM
Allright I will try this out, thanks man, also, I looked at that video prior to coming to the forum, as I knew I would probably need an array. Good job on that video by the way, informative :)
Title: Re: Help creating iteration with a button
Post by: djaydino on June 15, 2019, 05:47:03 PM
Hi.
Its not my video, but you can thumbs up his video :D
Title: Re: Help creating iteration with a button[SOLVED]
Post by: djaydino on June 17, 2019, 11:02:25 AM
Hi.

Here is a sample how to loop (attachment below) .

On the sample i use a int array, but you can use any kind of array.

There are 3 types i used :
Next Array Direct
Int Variable
Iterate

All of them are valid usages, in some cases "int" would be better to use, in other cases "iterate".
Same for Array direct.