godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.95k stars 21.07k forks source link

Unable to print to console in Godot 4 #82336

Closed marks-koi closed 1 year ago

marks-koi commented 1 year ago

Godot version

All versions of 4.0.

System information

MacOS Monterey 12.3.1 (21E258)

Issue description

In ANY version of Godot 4, when I wish to print anything to the console it does not show.

I wrote the following code to try to print to the console:-

var characters_name = "Mark"

func _ready():
    print (characters_name)

The console does not print the above statement. I went back to Godot 3 and was able to get the message to print to the console successfully though this means I am unable to enjoy Godot 4 on my Mac.

Steps to reproduce

Simply type the following code in any version of Godot 4 running on MacOS Monterey 12.3.1 (21E258):

var characters_name = "Mark"

func _ready():
    print (characters_name)

Minimal reproduction project

N/A

DennisManaa commented 1 year ago

Tried it on "MacOS Ventura 13.5.1" and for me it works. Can also confirm that it works on Ubuntu 22.04.

Did you make sure to attach your script to a node that is loaded when you are starting the game/scene? :)

Calinou commented 1 year ago

This is likely due to the same cause as https://github.com/godotengine/godot/issues/81893. Does your project take a long time to start in Godot 4 only (and can you reproduce this on an empty project)?

marks-koi commented 1 year ago

Tried it on "MacOS Ventura 13.5.1" and for me it works. Can also confirm that it works on Ubuntu 22.04.

Did you make sure to attach your script to a node that is loaded when you are starting the game/scene? :)

I'm reporting this as an issue from MacOS Monterey 12.3.1, im not using Ventura nor does the hardware support upgrading to Ventura.

Again, not too sure how we are linking Ubuntu into the context of this bug report.

The script is indeed attached to a node that is active and loaded. The console does not print the contents of my print message but simply prints this:

OpenGL API 4.1 ATI-4.8.15 - Compatibility - Using Device: ATI Technologies Inc. - AMD Radeon R9 M395 OpenGL Engine

marks-koi commented 1 year ago

This is likely due to the same cause as #81893. Does your project take a long time to start in Godot 4 only (and can you reproduce this on an empty project)?

I've created a new project and tried to do a print statement again and its the same issue, nothing prints. The project is very quick to start.

marks-koi commented 1 year ago

Please see the project:

https://github.com/godotengine/godot/assets/140932712/77446cf8-d63b-4f83-aae7-ee29a73b0ed6

Calinou commented 1 year ago

Do you have any external firewall software installed, or security restrictions that may affect local connections (such as parental controls, sandboxing, etc)?

DennisManaa commented 1 year ago

Okay, thanks for the clarification. :) I apologize if my previous message seemed unrelated to you. My intention was simply to help and to provide as much information as possible for the person who will hopefully address the issue. I did not mean to come across as mean if my text was interpreted that way. (e.g. it might be a problem that is specifically related to your version of macOS.)

marks-koi commented 1 year ago

Do you have any external firewall software installed, or security restrictions that may affect local connections (such as parental controls, sandboxing, etc)?

No my router has its firewall turned off. There are no parental controls or sandboxing activated.

I quickly turned my MacOS firewall off and the issue in Godot 4 persisted.

marks-koi commented 1 year ago

For comparison, here is the Print statement working in Godot 3.5.3. Same function does not print to console in Godot 4.

Are there any workarounds as I'm currently learning Godot 4 and this has stopped me in my tracks completely,

https://github.com/godotengine/godot/assets/140932712/4789e01b-f92f-45a0-8346-83eaea07b532

DennisManaa commented 1 year ago

It seems like the script isn't attached to your PlayerSprite-scene in the first video. Could you please try to attach it or am I missing something? image

In the second video it is attached: image

marks-koi commented 1 year ago

It seems like the script isn't attached to your PlayerSprite-scene in the first video. Could you please try to attach it or am I missing something? image

In the second video it is attached: image

Thank you. That actually has resolved the issue. I'm not too sure how the script detached!

DennisManaa commented 1 year ago

You're welcome; I'm glad that I was able to help. You wouldn't believe how often the same issue occurred to me. :D