How do I reference multiple instances within an event?

0 favourites
  • 6 posts
From the Asset Store
Be quick and choose the right answer for the shown equation.
  • So yeah, I want one specific instance to trigger stuff with another instance within an event. I tried this but it didn't work:

    Any ideas on how to do it?

    Another question: Can we do local variables within functions? Don't think we can but thought I'd ask. EDIT: Yes we can, boyah! Need to check the manual more

  • You will never get Character with UID 45 picked, because you already picked 201. Other issues aside, you must do a 'System:Pick all Character' before the Pick instance with UID 45.

    Edit:

    Another question: Can we do local variables within functions?

    Try it and see (I see you've already edited your post about this)

  • Thanks! I'm using local variables to check conditions of different instances right now and it works fine. Also just discovered I can pass variables to functions. So much stuff right beneath my nose that I'm missing

  • I have to say, dealing with objects by UID is not normally recommended.. as they will usually be different every run.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeh I know, I normally use an instance variable to identify separate instances. I just used the "pick instance" condition in this example for clarity

  • Also just discovered I can pass variables to functions.

    And they can return a value too

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