💦 CREATE AND FUCK YOUR OWN AI CUMSLUT 🔥 TRY NOW ♥
Create AI Cumsluts 💦
August 31, 2015

Frames Per Second

http://catlikecoding.com/unity/tutorials/frames-per-second/


August was filled with lots of activities for me, but not much coding or writing. But I did manage to produce a tutorial at the end!


This tutorial takes a look at measuring the frame rate of your scene. Not a glamorous topic, but an important one. You have the game view statistics and the profiler, but neither gives a good indication of the actual frame rate that you are getting when running your app. So we end up creating our own counter and use Unity's UI to show the FPS in the corner of the game window. It might seem trivial, but there are a few interesting observations to make along the way.

Comments (5)

C
Cam N · March 17, 2016

Hey Jasper! My lowest FPS value in the display jitters around, instead of only updating when it registers a new lowest number. Is this intentional? It even happens when I replaced my scripts with yours.

C
Catlike Coding · March 17, 2016

You always have a jittery frame rate, unless you exceed the maximum. Averaging over multiple frames just smoothes it. The averaged values still get updated every frame, but because they won't jump so erratically you're actually able to read them. As you keep spawning more nucleons, your average and maximum frame rate will begin to fluctuate as well.

A
Alexandru Iarca · March 12, 2016

Hi Jasper, I have a question. When we are building the array containing the two spheres, why are we declaring its type to be Nucleon[], as opposed to for example GameObject[] or anything else. I tried making a new "test" class and casting the array as it but it wouldn't allow me to populate the prefabs in it unless the had the "test" class as a component. I guess my question is how come casting as a component class allows you to populate it with the parent object along with all the other attached classes (rigidbody, renderer, etc). Thanks

C
Catlike Coding · March 12, 2016

We're using Nucleon because that what we're working with. This mandates that our objects have a nucleon component attached, which is what we want.

C
Catlike Coding · September 4, 2015

Forgot to put in the PDF link. It's there now!