Originally Posted By: Wicht
After the trouble at Garagegames/Instantaction, i played a little bit with Unity. But what i got was unacceptable logic.
Example:

Code:
function OnGUI () {
	if (GUI.Button (Rect (10,10,150,100), "I am a button")) {
		print ("You clicked the button!");
	}
}



With "if (GUI.Button (Rect.... " i should normally examine, if the object was created successfully or not, but not to get a click-event.


By the way:

I tried the mouselook-Example from the manual.

Code:
// Performs a mouse look.

var horizontalSpeed : float = 2.0;
var verticalSpeed : float = 2.0;

function Update () {
   // Get the mouse delta. This is not in the range -1...1
   var h : float = horizontalSpeed * Input.GetAxis ("Mouse X");
   var v : float = verticalSpeed * Input.GetAxis ("Mouse Y");
   transform.Rotate (v, h, 0);
}



You want to see the result? Click here


Sorry, but Unity is not the Holy Grail.


A barebone correct mouselook code is

Code:
var speed : float = 5.0;

function Update () {
	var x : float = Input.GetAxis("Horizontal") * Time.deltaTime * speed;
	var z : float = Input.GetAxis("Vertical") * Time.deltaTime * speed;
	transform.Translate(x, 0, z);
	transform.Rotate(Input.GetAxis("Mouse Y") * -speed, 0, 0, Space.Self);
	transform.Rotate(0, Input.GetAxis("Mouse X") * speed, 0, Space.World);
}