? Check if an OBJ with certain vars exists on the current layout ?

0 favourites
  • 3 posts
  • I really cant seem to figure this one out and i've run into this issue more than once now.

    The above screenshot is just one example of something I have tried, but I thought i'd share it to make my question more clear. I need some way to check if an Obj, with specific variable conditions, exists. And then, if it doesnt exist yet, ill create it, which should then switch the event chain off, since the object would then indeed exist.

    In the given picture I am trying to check with the inverted 'is on-layer' condition, but it doesn't work. I have tried similar things using the 'is on screen' and the 'pick' condition, but I just cant seem to get it happening.

    So, to simplify all this rambling, what is the best way to 'check if an OBJ with certain vars is on a layout'?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If negated/inverted isn't working you could try Else, but you have a lot of conditions going on.

  • If negated/inverted isn't working you could try Else, but you have a lot of conditions going on.

    πŸ˜‘πŸ˜‘πŸ˜‘πŸ˜‘πŸ˜‘πŸ˜‘

    Thank you newt

    πŸ˜‘πŸ˜‘πŸ˜‘πŸ˜‘πŸ˜‘πŸ˜‘

    This totally worked and I cant believe I didn't think to try the 'else' option.

    For anyone who may potentially have this issue in the future, just do this:

    If (Obj - Var=x) & (Obj - is on Layer x)

    > Then (... nothing)

    Else

    > Then (Create Obj)

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