How do I loop through objects out of container

0 favourites
  • 3 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • Hey,

    I got the following situation:

    1. I'm picking one instance of object by compare of type A.

    2. Checking foreach object of type B if the B object is overlapping with picked instance of the object A.

    3. Do action on object B

    My problem, is that object A and object B are placed in the same container and the result of the operation above is that foreach operation is only searching for the objects of type B which are belongs to the picked instance of type A.

    This is how containers work. I know that we could escape from the picked instance by using a function but I really struggle how the solution should look like in this case.

    I want to take an instance of type A and loop trough all objects of type B regardless of the container's relationship.

  • The fact that they are in a container should only affect the last action which is when you do the action on B. It will also do the action on the A in a container with B, that's just how containers work. The part about picking separate B for an overlap with A should be fine.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This should work:

    Bring B into a family.

    Pre-pick A as you like

    Family is overlapping A

    (For each A / if needed)

    Let me know if it dont work.

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