How to Show FPS on Screen in Godot

preview_player
Показать описание
Here's how you can display your games FPS on your screen in the Godot Engine. I mainly use this to Debug my games as it's pretty helpful.

~~~ FOLLOW ME ~~~

~~~ Products / Services I use ~~~
Graphics Card - 1050 Ti

DISCLAIMER:
some of the above links are affiliate links and I may earn a commission if you purchase them through my links. That being said, these are products / services that I genuinely do use. It's a great way to support me at no extra cost to you :)

Music used:
X Ray Vision - Slynk

tags:
#GodotTutorial #Godot #fps
Рекомендации по теме
Комментарии
Автор

One small tip: fps counter updates ones per second but you are calling the function and changes the Label's text once per frame - that lowers the FPS by itself!
I would suggest to use Timer so you could call a function and update the Label text once per second:
onready var fps_label := $FPSLabel

func _ready() -> void:
var fps_timer := Timer.new()
add_child(fps_timer)
timer.connect("timeout", self, "_on_FPSTimer_timeout")
timer.start()

func _on_FPSTimer_timeout() -> void:
fps_label.text =

igorthelight
Автор

straight forward, clean and simple much love, bless you

nabvhan
Автор

thanks for awesome, short and very useful tutorial!

sobirjonqadirov
Автор

thanks for making a simple, short tutorial.
you got to the point, and didnt waffle about. thanks :)

clubcyberia
Автор

Pls more content, this is really helpful

adran
Автор

Good stuff, but it's almost hard to hear you talk over the music, just a heads up

alexkt
Автор

It now shows the FPS for that scene but my game is in another scene

Edit: I linked to the ColorRect and made it a child of the camera and that worked

Galaxia
Автор

It works only if the script is added to the main scene, adding script to a label or another scene gives the "Invalid set index 'text' (on base: 'null instance') with value of type 'String'." error even if you mention correctly the name of label node in the script.

PavltheRobot
Автор

Invalid set index 'text' (on base: 'null instance') with value of type 'String'. PLS HELP

bnkm