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

Float issue with il2cpp in legacy 5.1.1f unity

Discussion in 'Scripting' started by majorapplesauce, Feb 26, 2020.

  1. majorapplesauce

    majorapplesauce

    Joined:
    Jun 15, 2013
    Posts:
    13
    Hello:

    Yes, i know ill have to upgrade soon but id like to try to finally get my game out the door. However, ive ran into something odd. It seems after i build my project for ios not everything works like it does in the editor. The big issue that im finding right now is i have a progress bar using a fillamount that requires a float. But even when i hard code .75f just for testing purposes it doesn’t work. Am I missing something that i need to be doing differently for il2cpp to like using floats and doables?

    Thanks in advance
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,748
    What does "doesn't work" mean? Does it cause an error, do nothing at all, come back with the wrong value? Be specific.

    And post your code
     
  3. majorapplesauce

    majorapplesauce

    Joined:
    Jun 15, 2013
    Posts:
    13
    Thanks for quick reply. Ill post the code when i get back to my desk. But “doesn’t work” in my case is that its just not setting the value. leaves it as default and doesn’t proceed to the next line in the code which is assigning a string to a textlabel. The error itself maybe getting gobbled up in my catch statement
     
  4. majorapplesauce

    majorapplesauce

    Joined:
    Jun 15, 2013
    Posts:
    13
    Attached is a pic from my phone (cant hit unity forums from my work pc). The function is updatelevelmeter()

    And this was the original code

    The latest i had commented out the level up check along with percentage value and replaced it with a hard coded .75f

    So works in unity but as I described earlier it seems like it errors out with the float assignment

    Thoughts?
     

    Attached Files:

  5. majorapplesauce

    majorapplesauce

    Joined:
    Jun 15, 2013
    Posts:
    13
    Hmm, well now im not quite sure about this being some issues with my float. When I comment everything out and just try to assign the letter A as a test to the textfield. Just the default shows

    Ill keep digging but if anyone out there has seen this crazy behavior. Then point out the mistake that i might be making. Keep in mind all of this works fine in the editor.

    One would think “why is he taking so long to debug this?” Well it takes about 30 minutes each time i make a build between my laptop and then zipping it to my mac mini
     
  6. majorapplesauce

    majorapplesauce

    Joined:
    Jun 15, 2013
    Posts:
    13
    [SOLVED] Not an issue with floating point. This ultimately ended up being that IOS doesn't like WCF at all which makes sense since the appropriate libraries are not added. Converted all my old API calls to REST and this fixed it.
     
    Kurt-Dekker likes this.
  7. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,971
    Thanks for the followup. One point of note: as long as you back up your project (or better yet, use source control always!), you should be able to come forward to Unity5.6.7 without too many issues, and all the fixes you do when doing that will still be applicable to future Unities.

    BUT BE SURE TO BACK YOUR PROJECT UP BEFORE YOU DO ANYTHING LIKE UPGRADE UNITY! YOU HAVE BEEN WARNED!
     
    majorapplesauce likes this.
  8. majorapplesauce

    majorapplesauce

    Joined:
    Jun 15, 2013
    Posts:
    13
    I should also mentioned (a lot of time has gone by since this post) I've managed to upgrade my project successfully to the latest version of unity! The only thing/reason i'm kicking myself now is with android :/ If i would have known that I may have been better off staying at 2019.2.X so that i could "still" have android x86 builds i would have....so that i could at least test on android studio with the latest emulators. I know there is bluestack which is android 7x...fine; but does nothing for me with my current android 10 issues (which i have another thread started for)
     
    Kurt-Dekker likes this.