камера вот такая, я нашел
using UnityEngine;
using System.Collections;
public class PlayerCamera : MonoBehaviour {
public Transform target;
public float xSpeed = 250.0f;
private Transform _myTransform;
private bool _camButtonDown = false;
private float _x;
void Awake (){
_myTransform = transform;
}
void Start () {
if( target == null ){
Debug.LogWarning( "camera: No target!" );
}else{
_myTransform.LookAt( target );
}
}
void Update (){
if( Input.GetMouseButtonDown( 1 )){
_camButtonDown = true;
}
if( Input.GetMouseButtonUp( 1 )){
_camButtonDown = false;
}
}
void LateUpdate () {
if(_camButtonDown ){
if( target != null ){
_x += Input.GetAxis( "Mouse X" ) * xSpeed * 0.02f;
Quaternion targetRotation = Quaternion.Euler( 0, _x, 0 );
target.rotation = targetRotation;
}
}
}
}