Nice solution, do you have an example of this script in action?
Update, I’ve found this thread. This explains how it works: