0 Favourites

How do I Stop everything exept one game object

  • Hello game developers,

    I'm new to this Engine, and i'm working on a falling object kind of game, where some random objects are falling from top of the screen and our hero character is saving himself (bottom of the screen), so the main issue is whenever these falling objects hit the character i want everything to stop(that's when a score screen comes up) and hero character does a litter animation of dying or something. I've managed to stop the game by "set time scale to 0" but this makes the entire game to stop and after that nothing happens the animation that i want to play doesn't work. Please help me on this or if there is some way by which i can select all the falling objects in the game because that way i'll only stop these ones by setting their speed to "zero" (i tried this way but only the one which is colliding stops)

    Thanks, hoping to hear some answers from you guys ....Cheers !!!

  • You can set timescale for individual objects too (there's a event command for it), so you can have a cursor move on a menu while everything else stops completely during a pause.

  • You can set timescale for individual objects too (there's a event command for it), so you can have a cursor move on a menu while everything else stops completely during a pause.

    that's right but the thing is i'm not able to select all the objects in the game that are falling, otherwise, i would've done this, could you tell me how to select all the objects in the game that are falling (these are basically one object with random x value)

  • you can use "For each" loop on a particular object to iterate through every object. And in the loop, you test for an object is falling or not. This depends on whatever behavior you are using on the falling object. (What behavior are you using?)

    if such object is indeed falling, set object timescale to 1.

    See: for "for each" loop.

  • you can use "For each" loop on a particular object to iterate through every object. And in the loop, you test for an object is falling or not. This depends on whatever behavior you are using on the falling object. (What behavior are you using?)

    if such object is indeed falling, set object timescale to 1.

    See: ... and-arrays for "for each" loop.

    sorry but it didn't work again it's doing the same thing it's only stopping the object that is colliding with the player( i want every instance of that object to stop),I've attached an image please check and see if you can figure out something that I'm missing here

  • The reason that only one object is affected is because in the event, you loop through smallenemy as a subevent. In the overlapping event, it is true only when a smallenemy collides with player, and only the ONE particular smallenemy will be picked in this case. Going through in the event further in for each, you will be looping through only that ONE particular smallenemy, not all of them.

    To remedy this, try "pick all" condition, placing it right on top of the event block that contains For Each.

    [quote:2vul3ulf]Pick all

    Reset the picked objects back to all of them. Subsequent conditions will pick from all instances again instead of filtering from only those meeting all the conditions so far. See How events work for more information on how instances are picked in events. Useful in subevents to start affecting different instances again.

    source:

    further reading: (see picking part here)

    additionally, knowing about UID (see UID section) might be useful in certain cases that require more complicated picking:

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Use this method, amitkuliyal.

  • The reason that only one object is affected is because in the event, you loop through smallenemy as a subevent. In the overlapping event, it is true only when a smallenemy collides with player, and only the ONE particular smallenemy will be picked in this case. Going through in the event further in for each, you will be looping through only that ONE particular smallenemy, not all of them.

    To remedy this, try "pick all" condition, placing it right on top of the event block that contains For Each.

    [quote:j65nxapq]Pick all

    Reset the picked objects back to all of them. Subsequent conditions will pick from all instances again instead of filtering from only those meeting all the conditions so far. See How events work for more information on how instances are picked in events. Useful in subevents to start affecting different instances again.

    source:

    further reading: (see picking part here)

    additionally, knowing about UID (see UID section) might be useful in certain cases that require more complicated picking:

    okay so that's what i was missing, thanks a lot man for these many refferences also , really appriciate it

  • Use this method, amitkuliyal.

    thanks buddy

  • You're welcome, amitkuliyal. The method will also work on other events such as Physics based objects. It's all up to finding a way to disable the source.

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