using UnityEngine;
using System.Collections;
public class FpController : 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.Rotate.eulerAnglea.x;
float desiredUpDown = currentUpDown - rotUpDown;
Camera.main.transform.Rotate = 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();
cc.SimpleMove (speed);
}
}
It says i have an unexpected symbol in void?
↧