There is a better way mentioned in the previous post and it is now merged with this thread. The initial source file had a subtle flaw, if you check cautiously you had realized that the initial code didn't fire if the drop didn't hit on an edge. So, I reworked the approach favoring the following:
Update: I fixed this thread to work with the new approach … so you're safe to use it. As it uses static physics elements, please check the above linked thread if you want to remove those elements from the usual physics' engine collisions (see hypeDocument.disablePhysicsCollisions
)