Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Object position normal in editor but just 0 in build

Discussion in 'Editor & General Support' started by war007007, May 15, 2019.

  1. war007007

    war007007

    Joined:
    May 24, 2016
    Posts:
    2
    Hello, i've been having this problems since yesterday out of nowhere, the bug consists of my "example.transform.position.x" being its normal x in the editor but in a build it equals to zero, i've also tried to see how a vector 3 "example.transform.position" looked like and got the same results.
    The objective is to make both character change sides when crossing one another, it works normally on the editor but it straight up does'nt work on a build, tried multiple pc and tried changing the script execution order.

    Here is the editor debug, as you can see, all the values are correct:


    And here is the build debug, as you can see, all the values are incorrect:
     

    Attached Files:

  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    5,236
    When behavior is different in a build than the editor, the first thing I check is for any errors at run time in the player log (what would output to the console in the editor). Often I find some unexpected null reference error that causes code following the error to not be run. Stuff like that.
     
    war007007 likes this.
  3. war007007

    war007007

    Joined:
    May 24, 2016
    Posts:
    2
    Thank you for your input, I've checked the "player.log.txt" that the build I just ran created and it has no errors or exceptions at all, only the "Debug.Log();" commands that I wrote my self for testing purposes (to see if the X values were zero even in the log files, and, in fact, they were and still are). I would post the "player.log.txt" file here but, as I'm new to this debugging "style", I don't know if the file contains any private information that would prevent me from sharing, please do tell me if I can post it and if you think it can help with the problem at all.
     
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    5,236
    The player log should be fine to post, but if it doesn't contain anything you didn't expect to see in there, it probably won't be as useful as I had hoped.