Difference Between Unity and Build?

Hi.

My code is working in unity, but then going crazy when I build it:

Any one have an idea why?

void FixedUpdate () {

		

		if(timer > 0)timer -= Time.deltaTime;

		

		if(timer < 0)timer = 0;

		

		if(timer == 0){

			

		timer = howLong;

		

			

		rotationY += Input.GetAxis("Mouse Y");

		rotationX += Input.GetAxis("Mouse X") * .9f;

		

		meh = new Vector3((-rotationY) * 5f, 0 , -rotationX * 5f);

			

		transform.Rotate(meh * .02f, Space.Self);

		

		rigidbody.AddRelativeForce (Vector3.forward * 20);;

		

			

		}

That’s the only code.

There is a missing } at the end, isn’t?

The missing curly brace and the two semi-colons on this line:
rigidbody.AddRelativeForce (Vector3.forward * 20);;

There’s no missing braces, I just didn’t see a point in including the using and class deceleration.

Removed the double semi colon.

But it’s still massively different.

Well, then you took out an extra curly brace 'cause there’s an opening one for both the method and the “if” statement, but only 1 closing brace. Please post the full code file.

EDIT: also, can you describe what “massively different” and “going crazy” is?

If I was missing braces, it wouldn’t compile.

The going crazy the camera rotates, based on where the mouse is pointed.

Sometimes in the exe, it just goes insane and rotates at a massive speed non stop, and doesn’t pay attention to mouse.

What happens if you use Update instead of FixedUpdate?

EDIT: that’s probably not the problem. Can you use Debug.Log to check the values of your Input.GetAxis(“Mouse X”) and MouseY? Those values vary depending on your mouse sensitivity, so maybe they’re returning different values depending on where it’s running in the operating system? Check their values in all areas.

Also, by any chance, does the amount of “crazyness” tend to increase the longer you’re rotating for?