Hello all,
I am new to Unity and JS so bear with me… I’m trying to change a rotate script so that it will run on an IOS device, but having a little trouble.
The script I have been using to rotate an object on my computer,
var verticalSpeed : float = 2.0;
var horozontalSpeed : float = 2.0;
var depth : float = 2.0;
function OnMouseDrag () {
var v : float = verticalSpeed * Input.GetAxis ("Mouse Y");
transform.Rotate ( -v, 0, 0);
var h : float = horozontalSpeed * Input.GetAxis ("Mouse X");
transform.Rotate (0, 0, h);
}
My attempt at the IOS script,
var verticalSpeed : float = 2.0;
var horozontalSpeed : float = 2.0;
var mouseDown : boolean;
function update (){
if(Input.GetMouseButton(0)){
mouseDown = true;
}
else{
mouseDown = false;
}
if(mouseDown){
drag();
}
}
function drag () {
var v : float = verticalSpeed * Input.GetAxis ("Mouse Y");
transform.Rotate ( -v, 0, 0);
var h : float = horozontalSpeed * Input.GetAxis ("Mouse X");
transform.Rotate (0, 0, h);
}
Am I even close haha?
Any ideas how I might be able to get this too work would be greatly appreciated.
Thanks, Garrett.