-
Collision detection on Shapes
Hey guys,
Context:
– I have a Shape Layer containing 161 shapes (squares), all of which have their Position property animated.
– I have 2 other Shape Layers. Each of those just contains 1 big colored circle.
Goal:
My intent is to have my 2 Circles act as some type of “Radial Effectors”, where they immediately change the color of the squares (which could be perceived as clones) they happen to intersect with.
So it’s as if the squares had 2 states: if they’re not intersecting with any of the Circles, their color is black. If they do intersect with the circles, then their Color property changes to the color of the Circle they’re intersecting with.
All of the above has to take into account the fact that my clones and Circles are in constant movement.
Progress:
I have tried/bought every Effector plugin on AEScripts and to my big surprise, none of them have allowed me to meet this goal. Some of them came very close, but after discussing with their authors and reading every plugin’s docs, it just doesn’t seem feasible.
I have since taken upon myself to carefully study Dan Ebbert’s Collision Detection script and tried to apply it to all of my Shapes, but I’m a bit lost when it comes to these questions:
– Should I apply the expression on every single square?
– How do I translate the calculation of the bounding box of a layer to the one of a Shape layer?
Final notes:
I have trimmed all the fat from my project file and just kept the essential before attaching it to this post. If you guys would be so kind to take a peek, I would be immensely grateful.
I feel like I can figure some things on my own, but for now I feel in great need of any guidance.
Thank you so very much!