Answer the question
In order to leave comments, you need to log in
How to move the camera while holding down any key?
Here's what I got
private void Update() {
pos = player.position;
pos.z = -10f;
transform.position = Vector3.Lerp(transform.position, pos, Time.deltaTime);
if (Input.GetKey(KeyCode.S)) {
bias = new Vector3(pos.x, pos.y - 5);
transform.position = Vector3.Lerp(transform.position, bias, Time.deltaTime);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question