Hi, Micheal It's very basic: - one vector has a reference to cubes and runs a recursive function on each elements against the others in the vector to check for position. - it uses Away3D excellent distanceTo() function: How easy was that?! - If they are too close it calls a function on the cubes (called avoid) - The cubes rotation is changed with a slightly randomized angle. The cubes move forward by using Away3D's function moveForward(speed) which saves me any direction calculations! - if they roam out of the allowed radius they turn around.
I wanted to use a true physic based detection, Jiglib but the hit on performance was too much. I might try to integrate with something like Flint using particles rather... I'll clean up the code and turn on the view source as soon as this goes live. Cheers, JJ.
