Change boolean not working...

0 favourites
  • 8 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • I'm having problems with an object.

    Object is berry bush

    Berry bush has a boolean called "Berry" set to false.

    False = Frame 0

    True = Frame 1

    If "Berry" is false, wait 5 seconds and set "Berry" to true.

    Left mouse click on Berry bush while player is overlapping sets "Berry" to false.

    The initial "Wait 5 seconds set to true" is fine. After i left click the bush, sometimes the frame will flash from Frame 0 back to Frame 1 in less than 1 second. Sometimes it will wait 2 to 3 seconds. Rarely does it wait the 5 seconds like I have set in the events. Any ideas?

  • Even in debug mode i can see the variable flash from 1 to 0 then back to 1 on the left click.

  • It could be one of many things, but we can't help without a capx....

  • Here

  • Object is berry bush

    Berry bush has a boolean called "Berry" set to false.

    False = Frame 0

    True = Frame 1

    You need a Trigger event for "Wait" to work properly.

    and one more tip for you.

    Berry boolean can be only either 0 or 1. And if your BerryBush have only 2 animation frames that represent Berry boolean state you can do something like that.

    On something: BerryBush: Set animation frame to self.Berry

    this will always set your animation to Berry boolean state.

  • >

    >

    > Object is berry bush

    > Berry bush has a boolean called "Berry" set to false.

    > False = Frame 0

    > True = Frame 1

    >

    You need a Trigger event for "Wait" to work properly.

    and one more tip for you.

    Berry boolean can be only either 0 or 1. And if your BerryBush have only 2 animation frames that represent Berry boolean state you can do something like that.

    On something: BerryBush: Set animation frame to self.Berry

    this will always set your animation to Berry boolean state.

    I switched it to its own event.

    BerryBush = Frame 0 -----Wait 5 seconds, Set berry to true.

    Still nothing happens. Am i misunderstanding what you mean?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Try

    +BerryBush = Frame 0

    +Trigger once -> Wait 5 seconds, Set berry to true.

  • Solved, Thanks guys!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)