how to Move or Rotate Main Camera
I made "CameraCtr" C# script
and i attach "CameraCtr" to Main Camera. and now what? i want to move or rotate Main Camera... please, someone help me.
using UnityEngine; using System.Collections;
public class CameraCtr : MonoBehaviour {
void Start () {
}
void Update () {
}
}
Comment
Best Answer
Answer by felixpk · Jul 22, 2016 at 06:38 PM
You could attach the following Script to your Camera for X-Rotation, the other axis are the same in green.
using UnityEngine;
using System.Collections;
public class CamRotation: MonoBehaviour {
public float rotationSpeed = 10;
void Update() {
Vector3 rotation = transform.eulerAngles;
rotation.x += Input.GetAxis("Horizontal") * rotationSpeed * Time.deltaTime; // Standart Left-/Right Arrows and A & D Keys
transform.eulerAngles = rotation;
}
}
Your answer
Follow this Question
Related Questions
How I can make my camera keep a distance between two objects? 0 Answers
Set the rotation axis of the camera 0 Answers
Weird Rendering Unity5 1 Answer
How to do a wall jump? i am very novice 0 Answers