I see, I thought you used some weird function of Unity, but that's a pretty simple and clever solution!