Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

How to add fps counter with toggle?

A Forum Thread for Baldi's Basics

No ads for members. Membership is 100% free. Sign up!
How to add fps counter with toggle?
Sign up to access this!
  • RealT5mpler avatar
    RealT5mpler Joined 9mo ago
    Not on right ok
    604 points Ranked 44895th
    15 medals 3 rare
    • Returned 1000 times Medal icon
    • 25 posts awarded Exemplary Feedback Medal icon
    • Submitted 15 Tutorials Medal icon
    • One month a member Medal icon
    • Returned 100 times Medal icon
    • 1 post awarded Exemplary Feedback Medal icon
    access_time 2mo edit 2mo
    Aight

    Make a new gameobject and add a text component

    Now add a new script component

    now after that copy this code into that
    (you should credit filename3 also he made this code)
    using UnityEngine;

    using UnityEngine.UI;

    public class FPSCounterScript : MonoBehaviour

    {

    public void Update()

    {

    if (Time.deltaTime != 0f)
    {

    this.deltaTime += (Time.deltaTime - this.deltaTime) * 0.1f;

    float f = 1f / this.deltaTime;

    this.fpsText.text = "FPS: " + Mathf.Ceil(f).ToString() + " FPS";

    }

    }

    public Text fpsText;

    public float deltaTime;

    }


    and save that and insert the text component onto the script component and then your done!!

    Never Give up on what you want avatar
    Mantra
    Never Give up on what you want
    URL to post:

Embed

Share banner
Image URL
HTML embed code
BB embed code
Markdown embed code

Author

Mr.Baldi avatar
Mr.Baldi Joined 1y ago
Offline
385 points Ranked 48358th
6 medals 1 rare
  • Returned 1000 times Medal icon
  • One month a member Medal icon
  • Returned 100 times Medal icon
  • 6 months a member Medal icon
  • 1 year a member Medal icon
  • 1 post awarded Exemplary Feedback Medal icon
Mr.Baldi
Sign up to access this!
Sign up to access this!
Sign up to access this!

Game

Sign up to access this!

Category

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • 0
  • 185
  • 1
  • 2mo
  • 2mo

WiPs by Submitter

More Modding Help Threads