Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Variables values changing from editor to build

Discussion in 'Editor & General Support' started by guizanchett, Oct 9, 2019.

  1. guizanchett

    guizanchett

    Joined:
    Dec 4, 2017
    Posts:
    6
    After building the app for android, initial values from some variables keep changing from the editor version.

    This is how the game behaves in the editor. Notice that "Current fuel" is set to 35.

    EditorMenu.png

    When I generate the build and play, this is what I get:

    PhoneMenu.png

    Another example is this shield resistance bar. In the editor:

    ShieldBarEditor.png

    And the build:

    ShieldBarPhone.png

    Notice that the life value doesn't change at all. In the editor all values are correct, but for some reason when the build is created these values are changed! Does anybody knows what is going on? Did anyone had this kind of problem already?

    *Edit: I'm using Unity 2019.2.0.f1

    Thanks in advance!
     
    Last edited: Oct 9, 2019
  2. Domas_L

    Domas_L

    Unity Technologies

    Joined:
    Nov 27, 2018
    Posts:
    111
    Hello! Could you please check if the player logs show any runtime errors in the build? On Windows, they can be found at "C:\Users\username\AppData\LocalLow\CompanyName\ProductName\Player.log" - https://docs.unity3d.com/Manual/LogFiles.html.

    If there are no runtime errors, could you please submit a bug report with a minimal reproduction project for this issue and reply in here with the issue ID?
     
  3. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    There is no need for a bug report, just show your code, and the results of your debugging on your Android device, either using Visual Studio step debugging or using Debug.Log and examining the device logs.
     
  4. GemstoneMiner

    GemstoneMiner

    Joined:
    Jan 1, 2022
    Posts:
    3
    Did you eventually find a fix for this bug?