Hi again, im guessing you already know whats up, another error or two. Here it is
ERROR:
error CS1061: Type UnityEngine.Quaternion' does not contain a definition for
eulerAngle’ and no extension method eulerAngle' of type
UnityEngine.Quaternion’ could be found (are you missing a using directive or an assembly reference?)
CODE:
using UnityEngine;
using System.Collections;
public class FirstPersonController : MonoBehaviour {
public float movementSpeed = 5.0f;
public float mousesensitivity = 5.0f;
public float UpDownrange = 60.0f;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
//Rotation
float rotLeftRight = Input.GetAxis ("Mouse X") * mousesensitivity;
transform.Rotate(0, rotLeftRight, 0);
float rotUpDown = Input.GetAxis ("Mouse Y") * mousesensitivity;
float currentUpDown = Camera.main.transform.rotation.eulerAngle.x;
float desiredUpDown = currentUpDown - rotUpDown;
Camera.main.transform.rotation = Quaternion.Euler (desiredUpDown, 0, 0);
//Movement
float forwardspeed = Input.GetAxis ("Vertical") * movementSpeed;
float sideSpeed = Input.GetAxis ("Horizontal") * movementSpeed;
Vector3 speed = new Vector3 ( sideSpeed, 0, forwardspeed );
speed = transform.rotation * speed;
CharacterController cc = GetComponent<CharacterController> ();
cc.SimpleMove( speed );
}
}
P.S.
This is gonna keep on going for awhile, so get ready.