I’ve just wasted the last 5 hours painstakingly trying to debug this function to no avail. I have broken it down to the most simplest of code blocks and it would seem it has now moved from obvious bug to the twilight zone and as a last resort I am coming on here for any clues as to what it might be.
Long story short, weird things were happening, I started to debug the code and I was finding certain Debug.Log statements were not being called. I racked my brain to think what could be causing a Debug.Log in the middle of a function to be called over and over but the Log message that was the first line of that function was never output. I removed all code so that function was completely empty apart from a Debug.Log, then nothing was output at all. Well obviously as anyone would think, the function is not being called! Thats what I thought, then I put a Debug.Log the line before the call to that function and that message worked. I put a Debug.Log after the line calling that function and that also was output but the Debug.Log INSIDE that function being called was not being output.
Starting to get rather nervous and concerned at my own sanity I started to fool around more and the more I played with the messages, the more things were not being output. The message that was working before the function was called I added some text to, and this was reflected in the output. I then appended a test function call to the Debug.Log, something like
Debug.Log(“START HERE 1” + simpleFunction());
Now that entire Log entry has vanished. I put it back to the way it was before I tried appending the function, and its completely gone still. However a Debug.Log immediately following still works.
It’s almost as if everything I touch will now get erased from exhistance if it calls another function and that line of code is poisoned forever.
Could this be the end of my sanity or is unity having a nervous breakdown?
The only thing I noticed which i thought was interesting was that the Script file is showing as 8999 lines long in Unitron. Have I crossed the LOC count between the sane world and the world of chaos perhaps!
HELP!