Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.

Ess-Ka/EsskaFOVDetector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Obsolete as VRChat now officially allows to detect the FOV:

https://creators.vrchat.com/worlds/udon/vrc-graphics/vrc-camera-settings

EsskaFOVDetector

Detects the vertical FOV of the main camera for VRChat.

grafik

Usage

Add the prefab to your scene and select your preferred detection mode.

On Start Detection runs once on start for VR and desktop.

Interval Desktop Detection runs once on start for VR and desktop and than intervalled for desktop.

Manually Detection has to be started manually with the StartDetection method.

An optional text field shows the status and detected FOV.

Get the FOV

Use the DetectedFOV property on the FOVDetector component.

React to changes

Register your component to FOVDetector and add the OnFOVChange method to react to changes.

Example:

public class YourComponent : UdonSharpBehaviour {
    public FOVDetector fovDetector;

    void Start() {
        fovDetector.Register(this);
    }

    public void OnFOVChanged() {
        Debug.Log($"New FOV is {fovDetector.DetectedFOV}°");
    }
}

Layer

The prefab is set to the PlayerLocal layer because this layer is used only by the main camera. Other layers can trigger the FOV detection in mirrors or on other cameras and will return a wrong FOV value.

About

Detect the vertical FOV of the main camera for VRChat.

Resources

License

Stars

Watchers

Forks

Languages