Sign in to follow this  
Doneyes

Mouse look script with java in Unity

Recommended Posts

It says I have compiler errors. Anyone see something wrong? I have been checking this for about 10 minutes.


public enum RotationAxis (MouseX = 0, MouseY = 1)

var RotationAxisRotationXY = RotationAxis.MouseX || RotationAxis.MouseY;

var sensitivityX : float = 400f;
var minimumX : = -360f;
var maximumX : = 360f;
var RotationX : float = 0f;

var OriginalRotation : Quaternion;

var RotationY : float = 0f;
var minimumY : float = -360f;
var maximumY : float = 360f;
var sensitivityY : float = 400f;
function Update () {
if(RotationAxisRotationXY == RotationAxis.MouseX){

RotationX += Input.GetAxis("Mouse X") * sensitivityX * Time.deltaTime;

OriginalRotation = XQuaternion = Quaternion.AngleAxis (RotationX , Vector3.up);

transform.localRotation = OriginalRotation * xQuaternion;

}
}

Share this post


Link to post
Share on other sites
You know unity is javascript not java right, there is no relation between the 2. As for your problem, I don't know the fix or problem

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this