Print command not printing

Godot Version

4.2.1

Question

hi all! I wish my first post was more elegant than this and feel pretty ashamed to ask but I wasted couple hours trying to sort this out :sweat_smile:

as I am doing some random tutorials, I am requested to do a super basic taskā€¦ print()ā€¦ and it just refuses toā€¦ Iā€™m 99% that it is a ā€˜ā€˜meā€™ā€™ problem but I donā€™t know where to look at anymoreā€¦

I have looked around, and googled my issue. most of the time it was people not toggling the message tab (thankfully that wasnt my caseā€¦) because my standard message is toggled on. :stuck_out_tongue:

I also looked at my debug settings, my stdout is enabled eveything seems fine.
no errors no warning but no printā€¦

now I am at the point of having only that line in my gdscriptā€¦ :
func _ready(): print(ā€œWTFā€)

thanks, looking forward to know what am I missing! :grinning:

Are you looking in the right place for the output?
The print command prints to the console and that is usually seen in the editor at the bottom under Output (Ouput should be blue in the editor)
Output from the print command will be prefaced with something like this:

Godot Engine v4.2.stable.official.46dc27791 - https://godotengine.org
OpenGL API 3.3.0 - Compatibility - Using Device: NVIDIA - GeForce 8600 GTS
 
--- Debugging process stopped ---

Alternatively, are you pressing the right run button?
The arrow button is to run the main code (which you specify) and the movie clapper button is to run the current scene being edited.

1 Like

Make sure that you didnā€™t disable the standard output messages in the Output dock by mistake.

This button:
image

5 Likes

thanks Sancho2, my output is blue and I did actually tried all start modes from the single play symbol to the ā€˜ā€˜folder clapperā€™ā€™

and the only thing I still see in my output is:

Godot Engine v4.2.1.stable.official.b09f793f5 - https://godotengine.org
Vulkan API 1.3.277 - Forward+ - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce RTX 4060 Laptop GPU

1 Like

thanks for the reply, yes I made sure it was not something as silly as this. even though I am sure it will be at the end :stuck_out_tongue:

Do you have an ā€œextends somethingā€ line at the top of the script?
Are there any errors showing?

2 Likes

thanks, I think that was it. I had no extends so I guess my script was attached to nothing?
after you said it, I just squeezed a print(ā€œwtfā€) under my extends CharacterBody2D and wtf showedā€¦

I had the feeling my script was not attached to anythingā€¦ could this been the case?

If you omit extends, the script inherits from RefCounted by default. However, the function _ready() is defined in Node, so Godot never called that.

1 Like

got it! that now explains why I never got that print message! thanks again everyone, now I can get back to my tutorials with the peace of mind and with a bit more knowledge :stuck_out_tongue:

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