Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: ben135 on April 01, 2014, 01:56:31 PM

Title: Store Trigger Count
Post by: ben135 on April 01, 2014, 01:56:31 PM
Is there a way to store the number of times the trigger is activated on a specific gameobject into a variable?
Title: Re: Store Trigger Count
Post by: sebaslive on April 01, 2014, 02:15:07 PM
You can send event to a new state with a float add, or float multiple add action that you can set to add 1.

You can then set a next frame event back to the trigger so that every time it is entered it adds 1 and goes back til it's triggered again.
Title: Re: Store Trigger Count [SOLVED]
Post by: ben135 on April 02, 2014, 02:51:54 PM
My global variable of the triggercount seems to be storing values it gets from the previous runtime (after on/off). Is there a way to reset global variables to its initial value?
Title: Re: Store Trigger Count
Post by: sebaslive on April 02, 2014, 04:19:25 PM
You can make an fsm that sets the value to 0 in a start state.
Title: Re: Store Trigger Count
Post by: jeanfabre on April 03, 2014, 08:28:16 AM
Hi,

 you are experiencing a bug, so yes, I would simply force the global variable value to 0 when the game starts.

bye,

 Jean
Title: Re: Store Trigger Count
Post by: ben135 on April 09, 2014, 04:05:12 PM
I tried setting up a state with the action "set float value" pointed to the global variable inside an empty game object in the start state. The action doesn't' get initiated. How can I fix that?
Title: Re: Store Trigger Count
Post by: sebaslive on April 09, 2014, 04:21:04 PM
Does it give an error, and if so, what does it say?
Title: Re: Store Trigger Count
Post by: ben135 on April 09, 2014, 08:45:14 PM
There are no errors. The global variable just doesn't change to 0 when I run it. The action is never used while I watch the game run.
Title: Re: Store Trigger Count
Post by: sebaslive on April 10, 2014, 01:26:15 AM
Not sure I follow, can you show a screen grab to see how the action is set up?