playMaker

Author Topic: Store Trigger Count  (Read 3111 times)

ben135

  • Playmaker Newbie
  • *
  • Posts: 14
Store Trigger Count
« 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?
« Last Edit: April 02, 2014, 02:52:06 PM by ben135 »

sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Re: Store Trigger Count
« Reply #1 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.
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

ben135

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Store Trigger Count [SOLVED]
« Reply #2 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?

sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Re: Store Trigger Count
« Reply #3 on: April 02, 2014, 04:19:25 PM »
You can make an fsm that sets the value to 0 in a start state.
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Store Trigger Count
« Reply #4 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

ben135

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Store Trigger Count
« Reply #5 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?

sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Re: Store Trigger Count
« Reply #6 on: April 09, 2014, 04:21:04 PM »
Does it give an error, and if so, what does it say?
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

ben135

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Store Trigger Count
« Reply #7 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.

sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Re: Store Trigger Count
« Reply #8 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?
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez