Actions

I hava an action triggered by keypress, I have it set to add and local. I want to prevent multiple triggers before the action completes. Help!!!

I would do it as follows.

  1. Find out how many frames are in your Action (lets say its 50)
  2. In the Logic Editor add a game property. name it ‘RunFrame’, set it to integer and give it the value 50 (or last frame in your action)
  3. Beneath your Keyboard sensor add a property sensor. Evaluation type Equal, Property ‘RunFrame’ Value 50.
  4. Connect your Keyboard and Property Sensor to an ‘And’ Controller
  5. Connect your And controller to your action Actuator, set the end frame to 50 and the Frame Property to ‘RunFrame’

When you hit your key the first time, the default value of ‘RunFrame’ is 50 so the ‘and’ triggers and runs your action. While the action is running it will be writing the current action frame into RunFrame which will not get to 50 again until the action has reached the end. This will stop the ‘and’ block being triggered again.

Thanks that worked great, really did not understand how the property and property sensor work together, thanks.