Quantcast
Channel: Answers by "RandomDeveloper"
Viewing all articles
Browse latest Browse all 8

Answer by RandomDeveloper

$
0
0
As Quanturn2 said, you would need to make the camera stay still but all the scenery rotates. First of all you should start with tagging all your scenery as scenery. Then simply do something like this script below does. var scenery : GameObject[]; var minAngle = 0.0; var maxAngle = 90.0; var rotate = false; function Start() { scenery = GameObject.FindGameObjectsWithTag("scenery"); //scenery is now a group of GameObjects that are tagged scenery. } function Update () { if (Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown(KeyCode.X)) { rotate = true; } if (rotate == true) { var angle : float = Mathf.LerpAngle(minAngle, maxAngle, Time.time); Debug.Log(angle); scenery.transform.eulerAngles = Vector3(0, angle, 0); if (angle >= 90.0) rotate = false; } } But don't use this code yet... for the best results you probably want to make all the scenery one big object tagged scenery rather then plenty small ones. Or you could tag only one of the scenery objects as scenery and parent all the rest to it. The code above has not been tested so i'm sorry if something goes wrong.

Viewing all articles
Browse latest Browse all 8

Latest Images

Trending Articles





Latest Images