Way to view a custom variable in debugger?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ondesic

Some languages have a place in the debugger that let you continuously view a variable you have typed in. This allows you to watch the one desired variable value without having to open a few nodes and members to get to the desired variable.

Is there something like that in Godot?

:bust_in_silhouette: Reply From: Alejandro Medina

I believe if you use breakpoints you will be available to see the value of variables, however I know breakpoints have some problems in godot

:bust_in_silhouette: Reply From: ZBot

If you wanna see a variable in the debugger you need to use export in your code.
Depending on what you export there may be a slght variation.

Here is a simple example for how to export a simple number to the editor via script:

Under the variables at the start of your script type:

export var nr = 5

this will make an editable variable appear as a script variable in the editor in the inspector on the object that the script is attached to.

My answer is offtopic sorry about that. i thought you were just looking for a way to access a variable so you can swap it around while working. English is not my native language I apologize.

Agreed, this answer was irrelevant.

40detectives | 2020-02-29 21:48