Unity Console Printing Two of Each Command?

Hello! I’m new to the platform and coding in general. I have my script all set up and it works fine but I’m just having problems with the console in unity printing my print commands twice. Any help would be appreciated!

Gamedev%20help%202print
Gamedev%20help%202print%20console

Hi LJ,

Welcome to the community. :slight_smile:

Three things you can check;

  • does the console clear when you run the game?
  • have you attached the script more than once to the same GameObject?
  • have you attached the script to more than one GameObject?

For the first, just run your game and note whether the console actually clears or not. If it does, great, that suggests one of the other two issues. If it doesn’t, try enabling Clear on Play;

image

Assuming the messages are still duplicated;

Within the Hierarchy on the left-hand side (typically), you will see all of the GameObjects which are within the current Scene;

image

Select each GameObject in turn and then view the Inspector on the right-hand side (typically) and look to see if the same script component is listed more than once.

image

Assuming the script isn’t attached to the same GameObject more than once, repeat the step above, but this time see if the script is attached to more than one GameObject.

Let me know what you find. :slight_smile:

Privacy & Terms