That's a nice idea, even if it's not simple for me :)
I should practice the raycast, it seems often useful!