There are a couple of first person camera control plugins available, adapting one of them might be easier than creating your own from scratch.