How do I loop through objects out of container

Get help using Construct 2

Post » Sun Jul 30, 2017 3:18 pm

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.
Posts: 12
Reputation: 235

Post » Mon Jul 31, 2017 9:00 am

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.
Posts: 2,342
Reputation: 52,693

Post » Mon Jul 31, 2017 12:13 pm

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.
Posts: 2,493
Reputation: 21,450

Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 2 guests