Two objects, each has instances overlapping one of two instances of a third object.
Object1 and Object2 each has an instance variable called "Home".
At the start of the layout, it checks to see of Objects1 and Object2 instances are overlapping either instance of Object3.
If so, then it takes the IID of Object3 and stores it to the Home variable of the Object1 and Object2 instances overlapping them.
However, I'm seeing that instances 0 thru 3, while overlapping instance 0 of Object3, have a Home value of 0 or 1...even though all four instances are overlapping instance 0 of Object3.
The events look like this:
Why, then, do some instances of Object1 and Object2 receive an IID value of the second instance of Object3 even when they're overlapping the first instance?
In the CAPX, look up event sheet "ES Set-Up", lines 4 and 5.
Thank you for your input and help!
Develop games in your browser. Powerful, performant & highly capable.
You need 'for each' there. Think about what instances are being picked in those events. For example, event 5 picks 12 NodePatrol instances and 2 NodeZone instances. Then the action basically says 'set the HomeZone variable of these 12 objects to the IID of these 2 objects'. It has no way to know which NodeZone goes with each NodePatrol.
Thank you, — I discovered that later on but hadn't had a chance to update my post. Thank you for confirming that, though. :)