Thanks to GitHub Copilot for the implementation! Just need to fully check it actually works, and then we can port it to Lua and Vector3.