How can one transfer an Object/Label from one scene to another?

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

I made a simple fps counter the problem is that if I switch scenes the fps counter disappears.

var FPS_Counter = false

func _on_CheckButton2_pressed():
if FPS_Counter == false:
	FPS_Counter = true
	FPS_Counter = false

func _process(delta):
if FPS_Counter == true:
	$FPS.text = str(Engine.get_frames_per_second())
	$FPS.text = str("")

Any Idea on how to transfer the Label to another scene?

:bust_in_silhouette: Reply From: Asthmar

FPS counter sounds like something you want to be on the screen all the time, look into singletons. They allow you to create global scripts and scenes that are always active in the scene tree.
doc link: :Singletons (Autoload) — Godot Engine (stable) documentation in English

(If you didn’t already, you will also want to have your label under a canvas layer so that it will always be ontop if you end up using a global scene.)

Hope that helps!