No Ghosts, demons talk allowed to here em! is a game that was made at the Global Game Jam 2018 hosted at NHTV Breda. The theme of the game jam was Transmission. It took inspiration from games such as Surgeon Simulator & Papers Please. My role within this game was mainly to create the core gameplay mechanic of being able to interact with objects in the world using just a mouse.
See the GIF below to see how this system works.
Hand Plane Rotation
I was having a very hard time trying to get something that felt easy enough to use just the mouse to interact with objects in the world while making it not seem sloppy since players would be interacting with physics objects. I took a look at how Surgeon Simulator handled their interactions and they use both the mouse and the keyboard. I tried this method but it didn't feel quite right in our game since we'd have much more sporadic shaking and so wanted to be able to move the mouse really fast instead of very precisely.
_startTransition is set to true when the mouse hovers over a UI element on the top or bottom of the screen. By using SmoothDampAngle I am able to get a very nice smooth transition from the one rotation to the other.
Above is just a simple check to see when the rotation of the plane hits within a certain threshold to stop rotating and get ready for the next transition.
Hand Plane Movement
Within the same GIF above the plane moves up and down. This is how the players are able to move the hand to pick up objects in the world and interact with them. Since the plane could be in any rotation, I needed a way to move the plane irregardless of which direction it was facing. The way that I solved this was by having a parent transform and having the actual plane a child of transform in order that I may move the local position and always have the plane move around a single point in the world.