As a side-note: I wrote this code on a laptop with an old version of Unity, I would love to run more tests on this and further optimize it however I’m running out of time today. If you spot any issues or optimizations, please get in touch with me here and I’ll update it with a credit to you.

I hope you find it useful!