Skip to main content
GameDev.net gamedev.net
🔒 Locked 🎮 Unity

Mouse look script with java in Unity

Started by Doneyes Aug 5, 2012 at 2:52 PM 1 replies 2.5k views
Original Post
Doneyes
Doneyes
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;

}
}
6677
6677
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
Doneyes
Doneyes
Oh I thought javascript and java were basicly the same idea...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.