hola estoy intentando hacer una vista en primera persona como la de metroid prime pero tengo problemas de rotacion , ya proble con mathf.clamp() , pero nada alguna subjerncia de como pueda arreglarla?
using UnityEngine;
using System.Collections;
public class CamaraSamus : MonoBehaviour {
public float velocidad = 10f;
public float margen = 5f;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update ()
{
if (Input.mousePosition.y >= Screen.height - margen)
{
transform.Rotate(-Vector3.right * velocidad * Time.deltaTime , Space.Self );
}
if (Input.mousePosition.y <= margen)
{
transform.Rotate(Vector3.right * velocidad * Time.deltaTime , Space.Self );
}
if (Input.mousePosition.x >= Screen.width - margen)
{
transform.Rotate(Vector3.up * velocidad * Time.deltaTime , Space.Self );
}
if (Input.mousePosition.x <= margen)
{
transform.Rotate(-Vector3.up * velocidad * Time.deltaTime , Space.Self );
}
}
}