using a timer within a rule..?

wfv7845wfv7845 Member Posts: 3
edited August 2015 in Working with GS (Mac)

I'm wanting to use the timer to perform a certain behavior within a simple rule I have. I'm not sure which behavior I'm wanting to include within the timer yet (either reset scene, change scene or pause game), but none of them seem to work when I put the timer inside of the rule. When I remove the timer from the rule it works fine on its on. I've included a picture of what I'm trying to do just in case I was confusing because I'm terrible at explaining things :s

<img src="http://i284.photobucket.com/albums/ll9/wfv7845/Screen%20Shot%202015-08-03%20at%2012.33.10%20PM_zpsnfcwkuge.png" border="0" alt=" photo Screen Shot 2015-08-03 at 12.33.10 PM_zpsnfcwkuge.png"/></a" title="photo Screen Shot 2015-08-03 at 12.33.10 PM_zpsnfcwkuge.png">photo Screen Shot 2015-08-03 at 12.33.10 PM_zpsnfcwkuge.png

anyone have any idea why this will not work? Thanks!

Comments

  • ArmellineArmelline Member, PRO Posts: 5,331
    edited August 2015

    What's probably happening is this:

    • The actor collides with the meteor actor.
    • Less than 3 seconds later, the actor ceases to collide with the meteor actor.
    • Because the actor is not colliding with the meteor actor after 3 seconds, the timer never triggers its contents - the reset scene never happens.

    Behaviours inside a rule will only run as long as the rule is still true. If the rule is no longer true before the 3 seconds have elapsed, the timer won't do anything.

    What you're showing in the logic there is essentially "After the actor has collided with the meteor for three seconds, reset scene."

    If you tick the "run to completion" box, it should work. Ticking that box will make this happen:

    • The actor collides with the meteor actor.
    • After 3 seconds, regardless of if the actor is still colliding with the meteor or not, reset the scene.

    That's probably your issue!

  • wfv7845wfv7845 Member Posts: 3

    I don't know why I didn't try that because I literally tried everything but. Anyways, thank you! It works perfectly now. :D

Sign In or Register to comment.