https://github.com/owl-man/fps-controller-for-unity
FPS (Frames Per Second) Controller for Unity
https://github.com/owl-man/fps-controller-for-unity
fps helpful-tool unity vsync
Last synced: 2 months ago
JSON representation
FPS (Frames Per Second) Controller for Unity
- Host: GitHub
- URL: https://github.com/owl-man/fps-controller-for-unity
- Owner: Owl-Man
- Created: 2021-10-02T08:12:02.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-07T18:33:39.000Z (almost 3 years ago)
- Last Synced: 2025-02-01T08:26:50.193Z (4 months ago)
- Topics: fps, helpful-tool, unity, vsync
- Language: C#
- Homepage:
- Size: 7.81 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FPS (Frame Per Second) Controller for Unity
By moving the **FPS controller.cs** script to the folder with your other scripts, you can limit the frame rate using the inspector in the Unity
(changing the **FPS** integer variable) or by calling the **SetFPS** method. Also, through the inspector (changing the **isVSyncActive** bool variable) or by calling the **DisableVSync/EnableVSync** method, you can turn off and turn on VSync (Vertical Sync). All these methods are located in the **FPS Controller** class, which can be accessed using a singleton.Example:
using UnityEngine;
public class Test : MonoBehaviour
{
private FPSController FPSCntrl;
private void Start()
{
FPSCntrl = FPSController.instance;
FPSCntrl.DisableVSync();
FPSCntrl.SetFPS(60);
}
}***FPS Controller script must be located in the scene and only once, to use its functions***