Is it possible to somehow detect how many objects are overlapping another object? I know you can do this within a fixed zone, but I want it for a moving object. Thanks to anyone who can help.
Perhaps when the object is overlapping the object, set an alterable value to 1. Then have another event which tests all the objects which have that alterable value that equals 1. The "Create new objects" icon has a condition which lets you "Pick objects with reference to their value".
edit: LOL, that wasn't relevant at all, sorry.
Edited by alastair john jack
lol
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
5th April, 2011 at 12:28:24 -
Select Object Extension.
Active A is overlapping Active B:
> Counter = numSelectedByName( "Select Object Extension", "Active A")
It won't work, because of the way MMF2 scopes objects. The easiest way to do this is definitely the Select Object Extension, which can do it with a single line of code like he said.
Well you'd need to run an fastloop that iterates through every single instance of the 2nd object, and then counts if its overlapping the first object. If the objects are of the same class, use a detector thats placed over the object you're testing to simplify it. Use the "foreach" object instead of fast loops, to speed it up alot
Set counter to 0
Start a foreach loop for object #2
On Foreach loop for object #2, If object #2 is overlapping object #1, add 1 to the counter