Last year, I wrote some code that used 4 optical sensors to "lock-on" to a goal and find its range by triangulation. I never got the chance to use it in actual competition, but it worked flawlessly during testing and we currently use it as one of our "Wow!" features during demonstrations--nothing is more fun than watch the robot automatically aim its soccer-ball launcher at certain team members...
Anyway, if you want to see the code, its part of CogCode2k2, which is available at my website:
http://www.robbayer.com