Set rotation

I am working on a function where when you hold alt you are able to look around without changing the direction you are travelling in. How would one revert the rotation back to the original rotation. And if possible, how would one make it look seamless so the camera doesn’t just snap back to the original rotation?

Hi, that is not perfect but it’s a beginning:

Thank you very much!