How to only run a specific GDScript when I press F5

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

When I play the project (by pressing F5), Godot always run all the GDScripts from all Nodes.
Is it possible to run only a specific GDscript I am interested to test run?

I am asking this because when I just want to test run specific GDScript, I do need the entire project to run. I ended up having to wait till all other scripts (which I am not interested to test) to run finish before the script I am testing get its chance to run.

Just run only the scene the script is in instead of everything.

There is a small button top right (CMD+R) on Mac

wyattb | 2021-05-29 16:27

But what if I have 2 nodes in the same Scene, is it possible to just run the script from one of the nodes?

andersonLearn | 2021-06-03 15:38

:bust_in_silhouette: Reply From: fraggynator

F5 runs the main scene.
F6 runs the current scene.

:bust_in_silhouette: Reply From: spoicat

Create a new scene, put your node that has the script attached there. And then press F6

But what if I have 2 nodes in the same Scene? Is it possible to just run the script from one of the nodes if I don’t want to add another Scene? Thanks for answering (:

andersonLearn | 2021-06-03 15:39

:bust_in_silhouette: Reply From: wyattb

Each node has a small eyeball (visibility toggle) in the scene tree. Just click on it to disable it before you run the scene.