0 votes

I know this is a stupid question, but how would I print a variable to the console?

in Engine by (114 points)

1 Answer

+5 votes
print(variable_name)

Hope this helps - not sure if you're asking for more. See here for details, and other print functions that you may find useful:
https://docs.godotengine.org/en/3.1/classes/class_@gdscript.html#class-gdscript-method-print

by (19,695 points)

Doesn't help, thank tho

The print statement will have to be inside a function and that function will need to be called at some point. You can put it inside the _ready() function to have it trigger when the program loads, inside _process(delta) to have it trigger on every game process update, etc.

It's the answer to your question. If you explain a little more what you're trying to do, perhaps you can get a more complete answer.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.