How to add fps counter

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

I want to know how to add fps counter in game that still tehere after export.

1 Like
:bust_in_silhouette: Reply From: timothybrentwood

Create a label and attach the following script:

extends Label

func _process(delta: float) -> void:
	set_text("FPS " + String(Engine.get_frames_per_second()))

Then put it somewhere in your scene.

String will not convert to String from a Float, as of Godot 4

String(from: String)
String(from: NodePath)
String(from: StringName)

You will need to use the str(float | int) method.

TheNormandyProject | 2023-02-19 14:18

This works in Godot 4

set_text("FPS %d" % Engine.get_frames_per_second())

terrarum | 2023-04-11 10:08

3 Likes