Our work here is done

Well, would you look at that while we were sleeping, some kindly programmer elves cobbled together some shoes for us! The Transform.rotation page of the Language Reference has a chunk of code that "smoothly tilts a transform towards a target rotation". That sounds a lot like what we're trying to do.

Hey, I have an idea: I'll keep an eye on the door. You copy and paste this code into your game. If anyone asks, tell them "the book made me do it".

Get Unity 3D Game Development by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.