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

Unity gives incorrect code line for error - always end of function

Discussion in 'Editor & General Support' started by AussieSwissDave, Aug 7, 2020.

Thread Status:
Not open for further replies.
  1. SkyGolem

    SkyGolem

    Joined:
    Oct 13, 2018
    Posts:
    2
    I read through the entire conversation haha. Didn't expect a fix to exist but hey, I'm very thankful for this thread.
     
  2. Sinister-Design

    Sinister-Design

    Joined:
    Sep 19, 2015
    Posts:
    65
    I keep running into this too, and it is driving me crazy. Unity didn't used to have this problem!
     
  3. mhhk88

    mhhk88

    Joined:
    Sep 12, 2013
    Posts:
    5
    @shinichikudo99
    The solution Unity gave you works for me too!!
    Thanks for sharing.
     
  4. Doker2030

    Doker2030

    Joined:
    Jan 7, 2022
    Posts:
    3
    I'm getting this problem now -- using VS 2022 and Unity 2020.3.27f1.
     
  5. Doker2030

    Doker2030

    Joined:
    Jan 7, 2022
    Posts:
    3
    Thanks very much for sharing the response from Unity (about using debug mode). Now i can continue fixing a bug i've been tracking for several hours.
     
    Sinister-Design likes this.
  6. ComandJupiter

    ComandJupiter

    Joined:
    Aug 14, 2022
    Posts:
    2
    I've been having this exact issue it's been driving me crazy all day I'm glad I found this thread I'm a little bummed that it's a glitch in the software I'm new to all this so just seeing what I messed up would be nice hope they fix it soon
     
  7. K0m1x

    K0m1x

    Joined:
    Aug 19, 2013
    Posts:
    30
    still not fixed, 6 years later, very disappointing.
     
  8. DragonCoder

    DragonCoder

    Joined:
    Jul 3, 2015
    Posts:
    1,492
    This is likely inherent to C# (or the mono implementation at least). The release mode optimizes too much away to reproduce the codeline in this somewhat special case (array accesses need to be especially optimized as they often occur in tight loops).

    Just use the debug mode as described here:
    https://forum.unity.com/threads/uni...r-always-end-of-function.947715/#post-6195646
     
  9. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,798
    Locking as this is a very old thread. Please create a new thread if you wish to continue the conversation.
     
Thread Status:
Not open for further replies.