Different game behavior between editor and standalone build

This is baffling me quite a bit, but since I’m rather new with Unity I might be doing something wrong that someone can hopefully point out!

In Short

  1. I preview my game in the editor using the play button, everything works fine: my player’s animation are working fine, and my top-down camera moves smoothly and is tilted at the proper angle. Good.
  2. I then do a Build Run to try the game out as a standalone application: my character doesn’t animate (just plays the default anim at start and then freezes in the last frame), and my top-down looks straight down (instead of being tilted 20 degrees).
  3. WTF?

Details
My Unity project is derived from the (very nice) 3DPlatformer tutorial. In order to test this by yourself, load the tutorial project and follow these steps:

  • Use the Unity Indie trial version

  • Open up the 3DPlatformer project

  • Create a new scene with a plane and the Lerpz player character in the center

  • Add an orbit camera and make it follow Lerpz

  • Drag the ThirdPersonController and ThirdPersonPlayerAnimation scripts on Lerpz

  • Have a test run in the editor (playmode). You should be able to make the character run around and it should animate properly

  • Go to File > Build Settings

  • Select OS X Universal Binary Standalone and click Build Run button

  • Once it’s finished, test the application in Beautiful, 640x480 windowed mode. Everything should work fine too.

  • Now go back to the editor, and create two new blank javascripts called TutPlayerController and TutPlayerAnimation, respectively.

  • Copy/paste the entire content of ThirdPersonController script into TutPlayerController and change the path of the @script AddComponentMenu line so that it doesn’t use the same menu path as the ThirdPersonController script

  • In the same fashion, copy the content of ThirdPersonPlayerAnimation to TutPlayerAnimation

  • In TutPlayerAnimation script, replace references to “ThirdPersonController” to “TutPlayerController” and save

  • Click on Lerpz and remove (or disable) the ThirdPersonPlayerAnimation and ThirdPersonController scripts

  • Replace them by TutPlayerController and TutPlayerAnimation

  • Have another test run in the editor’s playmode. Everything should work fine (the character moves and animates as before)

  • Now make a new build through File > Build Run

  • Run the game with the same settings as before: you should now be unable to move the character around and it doesn’t animate either (past the default anim, that is). You can just orbit around the character with the camera.

I’ve probably done something wrong along the way, or messed up some of the original files, but could someone try this and see if they can reproduce the effects described above? What baffles me a bit is that it works perfectly fine from within the editor (in playmode) but behaves differently when build ran as a standalone application.

Any ideas?

I continued my investigations on this matter and I I tried to create a new blank project and only import the Lerpz model and the 2 scripts I modified. Seems to be working fine in the standalone build now, so that’s cool.

It would still be nice to know what’s causing this in the other project though, as it could potentially be an engine/editor bug. But it’s more likely a bad manipulation on my part. Anyway, if someone has an idea, please shout :slight_smile:

When you run it in the editor, are there error messages at the bottom?

No, no error messages. I checked the console log too.

hmmm… so it runs fine in editor but not in standalone, try create a new project then taking the faulty animations/character into that and doing a standalone as that because it could be a messed up file in your project not the others.