How do I start an action with a objects with different UIDs?

0 favourites
  • 2 posts
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • Hey, I would like to know how to trigger an action with 2 or more instances of the same object, that will destroy 2 instances of another object.

    So far, I thought it would work like this:

    Thing Pick instance with UID 001

    Thing Pick instance with UID 002

    Thing is True

    Stuff Pick Instance with UID 03 -> Destroy Stuff

    Stuff Pick Instance with UID 04 -> Destroy Stuff

    Any tips?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So you need pick 2 instances of Thing, check if some boolean instance variable is true for both of them, and then destroy 2 instances of Stuff?

    You can do this:

    System pick Thing by evaluating ((Thing.UID=1 | Thing.UID=2)  & Thing.someBoolean=1)
              Stuff Pick Instance with UID 03 -> Destroy Stuff
              Stuff Pick Instance with UID 04 -> Destroy Stuff 
    [/code:1493o4fq]
    
    It's a bad habit to use fixed values for UIDs in your code, you should use instance variable "ID" instead.
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)