How do I make instances of an object appear/disappear in sequence?

0 favourites
  • 7 posts
From the Asset Store
112 High-Quality destruction sounds for videogames
  • So i have multiple instances of an obgect on screen and i want these to appear or disappear/destroy in sequence. For example half of a second apart. Because all instances are the same object, they appear all together.

    Thanks

  • Use Visible or Opacity. Visible is a binary state with 2 options while Opacity is a percentage.

  • great Crab_00 So i've made all objects with opacity 0 and then added a foreach > object > set opacity 100 with a wait of 1 sec. This doesn't work as it does this for all instances together.

    How can i say foreach > object > <THIS>.set opacity to 100 > wait 1 sec

    Or something like that.

    I also tried to update a count variable in foreach with a wait, but its not updating the count one by one.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Maybe try having the wait 1 second be on the event directly preceding the foreach event. So that It will wait a second before making each object disappear almost simultaneously rather than Making an object disappear every second.

  • You can use instance variable to control opacity

    https://drive.google.com/file/d/1lE0ATF8oK6CPFRubed_HJSk3m0Lv47Lv/view?usp=sharing

  • Thanks i just had to add waitxloopindex

    Thanks

  • Thanks i just had to add waitxloopindex

    Thanks

    wait*loopindex, might not be the best approach if im not mistaken... i hope i am.. all the bellow conditions will wait *loopindex not just the actions in the loop you created.

    this was a known "issue" or mechanical thing since construct classic, i don't think it changed.

    how are other conditions under the loop firing?

    i would do a object.variable, and set it to 1 by loopindex for each object and use the wait time trigger behavior.

    and then on a separated condition trigger

    if object.variable =1 set timer to 1 second

    subevent

    if object.timer = true

    ibject.opacity<100 set opacity to self.opacity+10

    then another condition control on a new line

    if object.opacity>100 set variable to = 0

    this approach avoids having to delay the rest of the event sheet code bellow your wait*loopindex ... again maybe that changed... but i remember that was a big issue, especially when you have animation parts or collisions needing to happen instant.

    Reason for that being you are telling the "system" to wait not the object.

    i would do you a example of my code above, but since google drive doesn't wanna directly connect to my construct .. im lazy to manually upload it.

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