Learn JavaScript in Construct, part 11: Construct APIs

You're viewing a single comment in a conversation. View all the comments
  • 2 Comments

  • Order by
  • How can I pick an instance by an instance variable?

    • Just in case this is still relevant (for anyone with the same question): check out the fairly new example titled "Generator Function" for one way; but using generator functions is not required, you can just do that too:

      for (const inst of runtime.objects.SomeObjectType.instances())

      {

      if (inst.instVars.SomeInstanceVariable === 42) {...}

      }