Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Build's in Unity5 are not comparable to the editor version!

Discussion in 'Unity 5 Pre-order Beta' started by Ravel, Feb 28, 2015.

  1. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    In editor my scripts work, but in a build something gets messed up and scripts dont work.
    The build run's, but my custom actions dont work.

    In short:
    I have a user helper script in my simualtion project, wich helps the user to automatically engage the clutch while shifting. This works in the editor, but in a build there's no effect! Also it worked in Unity 4.x

    Posting code is not nececery, it worked before and it works in the editor.
    My script gets updated in FixedUpdate() right before I pass the values to my plugin, so everything seems logical.
     
  2. Freezy

    Freezy

    Joined:
    Jul 15, 2012
    Posts:
    234
    Just to state the obvious, if you reference anything using UnityEditor; related, builds will fail.
    Probably not the reason, but just double checking.

    Check the player logs from the builds, most of the time it will tell you what went wrong.
     
  3. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    According to the logs everything is OK as it should be. I'm suspecting that Unity5 has a different timing route for builds maybe? I hope there's a work around or it will get fixed in RC4
     
  4. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,306
    If you don't file a proper bug report it almost certainly won't be fixed. But from your description I'd assume it's actually a problem with your code that has to be fixed on your end. Sometimes creating a nice repro project is a good way to find the issue ...
     
  5. Freezy

    Freezy

    Joined:
    Jul 15, 2012
    Posts:
    234
    not knowing the extent of your code or the plugin, you might be able to delay the initialization to say a second after unity stared using a delayed invoke (http://docs.unity3d.com/ScriptReference/MonoBehaviour.Invoke.html)

    after that you simply set a bool to true (or use awake & enable ) to allow your updates to function as needed.

    Because such invokes are not done in a truely multithreaded way, but actually called in a frame that is passed the time delay, you would skip any unreferenced uninstantiated stuff. Though those should all get caught by the Unity player log.

    If all else fails a try {} catch() might shed some light on the situation
     
  6. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Different behavior in editor vs. build is almost always the result of relying on undefined behavior.

    --Eric