- Home /
Rotating camera in a circle using left and right keys..
Hello,
Does anyone know a script to allow control of the camera during gameplay with the left and right arrow keys in a circular motion around the game world?
Thanks!
Answer by tobmuell · Mar 10, 2013 at 01:19 PM
If anyone has the same problem. I simply solved it by making the camera a child of another game object. Then I moved the camera so that it looked at the empty game object. Now I can simply change the rotation of the parent object and indirectly move the attached camera. To move the camera with the left and right arrow keys (and also the A and D keys) I attached this line of code to a script of the empty game object. You should adjust the Value of GetAxis with a multiplier since this is very slow, though.
transform.Rotate(Vector3.up * Input.GetAxis("Horizontal"));
Your answer
![](https://koobas.hobune.stream/wayback/20220613010027im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Move the camera to the left when the mousecursor is left 1 Answer
Stop Motion Camera Effect 0 Answers
Aligning Camera to Object 2 Answers
Super mario Camera Script 0 Answers
InvalidCastException when trying to use spring follow camera script 1 Answer