Reset Time for doAfter Block

DonPepe

  • Posts: 47
Hey,

Is this possible? I have kind of a status on an Actor if he collects an Item. After 5 seconds he gets the idle status back. I do this with a doAfter-Block. Now if he collects a similar item within the 5 seconds the status still gets set to idle after the 5 seconds of the item he collected first, so if I could reset the doAfter block or set the time to a new value this would solve my problem very easily.

Thanks for help,
DonPepe
And death puts aside his scythe and climbed on the combine harvester. Cause it was WAR!

Luyren

  • *
  • Posts: 2726
Hey,

Is this possible? I have kind of a status on an Actor if he collects an Item. After 5 seconds he gets the idle status back. I do this with a doAfter-Block. Now if he collects a similar item within the 5 seconds the status still gets set to idle after the 5 seconds of the item he collected first, so if I could reset the doAfter block or set the time to a new value this would solve my problem very easily.

Thanks for help,
DonPepe

Make a number attribute, and start incrementing it after you collect the item. When it's equal your 5 seconds, reset this number to 0 and return to the idle state. If you collect another item during the wait time, reset the attribute to 0.

This should do the trick.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter