How to create a Frame Counter in UE4?

I want to see how many frames I am getting. (FPS) . How could I do this using a widget blueprint. (Picture example would be great).

Thanks in Advanced!

I think the code to get your fps would be 1 divided by your delta seconds.

Hello,

For reference, you can always use the console command during PIE by bringing up the console by pressing the ~ key and typing in stat fps.

Here is a simple Frame Counter that I have created using a Widget Blueprint.

First, I added a Text component to the Widget Blueprint. I then anchored the text component to the top right, and deleted the default text. Then, go into the details panel of the Text Block and next to where you deleted the default text, click the Bind option and create a new binding.

Moving on to the Widget Blueprint’s Event Graph, I’ve set up a custom event that I named Show FPS and set a looping timer to call the event every .02 seconds. This event grabs the Frames Per Second using the 1/Delta Seconds formula. Then, I created a text variable called FPS that I set using the return value of the 1/DeltaSeconds.

Finally, I went into the Level Blueprint and created the widget and added the widget to the viewport.

Feel free to ask any questions regarding the setup.

1 Like

You don’t need to create a new binding, you can bind to your “FPS” Text Variable you created in the event graph, straight from the hud