You know how in some games you have a scripted cut scene, but the player can still move the camera a little, but the camera is kinda moving to whatever the player is supposed to be looking like there’s some magnet pulling it?
Im guessing that id have to start with my Look At rotation and than add mouse axis stuff rotation on to it, but than also lerp it back to look at transform at the same time… Would that approach even work? XD
If I were implementing this, I’d have an invisible game object that was the lerp-to target of my camera. That camera target would have a script that set its position based on where the default camera position is and add the joystick axis information to that. Then you’d get the smooth movement of the camera and it’d constrain the camera to that general location while still giving the user control.
Pretty much! Not much to add except just be sure to use the correct execution order if you use separated scripts to compose the movement. Also remember Update always comes before LateUpdate regardless of execution order.
For example, first set the absolute camera position (apply cutscene animation) second you add the offset (which the user inputs with analog sticks, mouse, etc) and like you said such offset should be constantly decaying to 0 with a Lerp
Also remember that animation component runs after Update, but before LateUpdate. In other words, if a camera is being animated with an animation component, apply offset in LateUpdate.
You just have be careful, if you’re offsetting after the animation component, and the camera animation ends while you’re adding an offset constantly after animation… instead of a relative offset, you’ll be offsetting the camera like… very fast… For example if the offset is 1 unit to the left, the camera will move 1 unit to the left per frame… when ideally it should be 1 unit relative to camera animation, so be sure not to add offset after camera cutscene animation ends and no other animation is playing.