I have a really weird problem. For a puzzle game, the path of the solution gets traced by rotating a cube when the player finishes a level.
This works perfectly in the Unity Development Environment (I’m using Unity 3.4, and I’ve tried this issue in both non-Pro and Pro versions). However, the code that rotates the cube, for some reason, does NOT work in the build. The rest of the script works perfectly, just that one little part of the script does not.
Here is the little bit of code that rotates the cube:
Camera.main.transform.rotation = Quaternion.Lerp(Camera.main.transform.rotation, cameraRot, Time.deltaTime);
cameraPos = Camera.main.transform.rotation * new Vector3(-0.06848729f, 0.0f, -1.0f) + cube.transform.position;
Camera.main.transform.position = Vector3.Lerp(transform.position, cameraPos, Mathf.SmoothStep(0.0f, 1.0f, (Time.deltaTime * 10)));
Anyone have any ideas? Or ever had a similar experience?