How do I loop through objects out of container

Get help using Construct 2

Post » Sun Jul 30, 2017 3:18 pm

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.
B
5
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.
B
47
S
17
G
81
Posts: 2,224
Reputation: 48,095

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.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 23 guests