- Home /
Question by
machinedoll · May 09, 2017 at 05:53 AM ·
rotationzoom
Zoom and spanning not working together
PLEASE HELP!!! zoom is working and i can control my player too
void Update() {
float horizontal = Input.GetAxis("Horizontal") * turningSpeed * Time.deltaTime;
transform.Rotate(0, horizontal, 0);
float vertical = Input.GetAxis("Vertical") * movementSpeed * Time.deltaTime;
transform.Translate(0, 0, vertical);
Zoom();
}
void Zoom(){
float y = Input.mouseScrollDelta.y;
Debug.Log(y);
if (y > 0){
follower.transform.position -= new Vector3(0, 0.25f, -0.25f);
Debug.Log("Zoom In");
}else if(y < 0){
follower.transform.position -= new Vector3(0, -0.25f, 0.25f);
}
}
However, when i try to rotate my player and zoom in and out in the same time, the camera will no longer in the correct position.
Anyone know how to deal with this?
Comment
Your answer
Follow this Question
Related Questions
Camera Zoom from rotation. 0 Answers
Android touch and go,zoom,rotation 0 Answers
How do I rotate the camera upwards when zoom is close? 0 Answers
Problem with "zooming" and rotating 0 Answers
Need help implementing a zoom function 0 Answers