Console not printing

I was on Section 3 - 51 - Tagging game objects. However the console was not showing any logs when I ran the game. Toggling icons doesn’t help. I have tried to delete the script and recreate the script but it was the same.

Any idea?

Hi kondev,

Welcome to our community! :slight_smile:

Have you already compared your code to the Lecture Project Changes which can be found in the Resources of this lecture? Make sure the method names are spelt correctly. The messages are enabled in your console, aren’t they?

The code have no difference from the Lecture I have made sure of that. Messages are enabled but no matter what I did the console was empty.

Could you please share screenshots of what you see in Unity? And your relevant code as formatted text?


See also:


The screenshot of the console. The console remained empty no matter what I did. It works fine when I print a normal string but the code below did not response. Tags were applied correctly.

   void OnCollisonEnter(Collision collision)
    {
        switch (collision.gameObject.tag)
        {
            case "Friendly":
            //do nothing
                print("ok");
                break;
            case "Fuel":
                print("fuel");
                break;
            default:
                print("dead");
                break;
        }
    }

There is a tiny typo on the method name. :wink:

Test OnCollisionEnter. Did this fix it?


See also:

I can’t believe I checked the spelling for 3 times and still missed the typo. Thanks a lot for pointing out. It works now!

It’s a veeeeery typical issue and fairly hard to detect. I read the name three times to ensure that the “i” is really missing before I wrote my answer.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms