So, I’m basically new to Unity and have been messing with it for the past couple of days. I’m fairly familiar with coding, but am having a little bit of a hard time wrapping my head around how to handle vectors and easing.
I have an object that’s the only subject in my scene. I have an empty GameObject (called CameraTGT) that’s parented to my subject. I want to be able to rotate the camera around that CameraTGT object when I’m holding down the left mouse button, but when I let go, I want it to follow the direction the mouse was going, but to ease to a smooth stop.
I’m guessing that I would grab my camera’s position from the previous frame and my camera position from my current frame and make a vector out of it. If the MouseButton is down, then it doesn’t ease at all. If the MouseButton is up though, it should calculate the vector for the current frame, and then each subsequent frame should be multiplied by something like 90%, until it’s basically at a stop.
This sounds stupid, but I can’t understand how to translate the camera’s positions to a Vector that can then be applied repeatedly on future frames so that it slows to a stop…
PS - the object can’t rotate, only the camera…
Any suggestions?