Debug.Log(xxxx)

So I have a large chunk of code that I’d rather not post if possible because the problem doesn’t really lie in the code.

Inside the update function I have a series of movement on command things, hold A go left, etc, it all works phenomenally. It works exactly as it should the problem comes from one single line of code.

Debug.Log (" ");

If I remove Debug.Log, the whole program goes to absolute shit, nothing works as it should, unpredictable, backwards, inside, and out. If I put Debug.Log back into the function it instantly works again.

So the question is, how the hell do I make it work without using Debug.Log or what possible reasoning could there be for this to cause problems.

I ran the code over with a friend and apart from a couple other problems he saw no reason that this line should be causing my code to break.

Any help much appreciated.

In theory use of Debug.Log could only affect execution in three ways:

  1. Time sensitive operations because Debug.Log is very slow.

  2. The contents of the log statement performs some logic:

    Debug.Log("Some output: " + DoSomething());

    Debug.Log("Some output: " + SomeCleverProperty);

  3. Additional logic has been injected into the logging process by using Application.RegisterLogCallback.