- Home /
Camera, Look rotation, smoothly?
"How to lock first person camera onto an object freeze mouse look and do it smoothly? "
This is what I have at the moment, it lets me switch between targets smoothly.
However it does not alter the look rotation on the y axis.
How can I achieve this? and how can I get the camera to smoothly correct itself after all targets are down or I have deselected targets. Thanks in advance!
void Update () {
if(Input.GetKeyDown(KeyCode.Tab) ||
selectedTarget.GetComponent<EnemyHealth>().enemyDown == true){
TargetEnemy();
}
myTransform.rotation = Quaternion.Slerp(myTransform.rotation,
Quaternion.LookRotation(selectedTarget.position - myTransform.position),
rotationSpeed * Time.deltaTime);
}
Comment
Your answer
Follow this Question
Related Questions
smoothly rotate camera around an object with momentum 0 Answers
Screen.lockCursor messes my rotation 1 Answer
Move and rotate the camera at the same time 2 Answers
Smooth Rotation 2 Answers