1

I used the latest Unity 4 with UnityScript (didn’t want to upgrade to Unity 5 before releasing the game, just to avoid complications). Unfortunately, I had to upgrade to iOS 9 and to Xcode 7. The game was built in Unity then opened in Xcode, however during deployment on iPhone I started getting error:

clang: error: linker command failed with exit code 1 (use -v to see invocation)

After upgrading to Unity 5, Xcode deployment to phone works, however on the phone I’m not able to load another scene by clicking on GUI button or with timing, it just doesn’t load, however works in the Unity editor.

Is there something wrong with Application.LoadLevel (“NewScene"); or perhaps something else needs to be done or done differently?

Also, for some reason, rotation of the object stopped working in Unity5 (even in editor)

transform.Translate(Vector3.left GameManager.speed/12 Time.deltaTime, Space.World);
GetComponent.().angularVelocity = direction * 500;

Is there anything can be done to fix both issues? Or perhaps I need to downgrade to Unity 4, then how do I fix Xcode error (above)?

user3071284
  • 6,955
  • 6
  • 43
  • 57
Userr125
  • 11
  • 1

2 Answers2

1

Make sure you scene is included in Build Settings (File -> Build Settings...)

transform.Translate(Vector3.left GameManager.speed/12 Time.deltaTime, Space.World);
GetComponent.().angularVelocity = direction * 500;

This won't even compile because of numerous syntax errors, I bet you wanted something like this:

transform.Translate(Vector3.left * GameManager.speed / 12 * Time.deltaTime, Space.World);
GetComponent<Rigidbody>().angularVelocity = direction * 500;

If this doesn't work make sure you have Rigidbody attached, disabled Rotation Freeze on desired axis and check if direction has any value (not (0,0,0))

Also note that you shouldn't use angularVelocity directly. Unity Documentation states (http://docs.unity3d.com/ScriptReference/Rigidbody-angularVelocity.html):

In most cases you should not modify it directly, as this can result in unrealistic behaviour.

You could use http://docs.unity3d.com/ScriptReference/Rigidbody.AddRelativeTorque.html instead.

Rafal Wiliński
  • 2,240
  • 1
  • 21
  • 26
0

I had the same problem after upgrading to Unity 5.2 & Xcode 7 for iOS 9 , but I had to revert back because of random issues on Unity3d 5.2 of UI , Events Systems in my project. Go to through below link request for the beta build.

http://forum.unity3d.com/threads/crash-upgrading-to-4-6-8p2-on-application-loadlevel.354899/#post-2315179

user1169079
  • 3,053
  • 5
  • 42
  • 71