Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Question Additional cameras take on the FOV of main camera in Unity VR

Discussion in 'VR' started by CommandoP, Mar 27, 2022.

  1. CommandoP

    CommandoP

    Joined:
    Jan 21, 2022
    Posts:
    4

    Hello,

    Im working on a VR project and have ran into an issue within Unity 2019 lts (URP) that is driving me batty. I am using an XR rig and steam VR integrations; and i am trying to make a sniper scope using the render texture method, but at runtime the fov of the camera changes to match my main VR camera, which essentially makes an anti-scope that is zoomed out so far that its behind the player.
    Yeah so this is useful if you want a S***ty (because its like super fisheye) 3rd person window in your game but useless for a scope. I do not have this problem when using the built in pipeline, but I am not inclined to use that as its causing me other, possibly more frustrating issues relating to water that im just not having in URP. I also do not have this issue in the HDRP but I'm finding that to be exceptionally non performant in VR (despite looking GORGEOUS)

    How can I fix this camera FOV nonsense?
     
  2. arfish

    arfish

    Joined:
    Jan 28, 2017
    Posts:
    777
    Hi,

    Have you tried to set the FoV for the camera rendering to texture, while it's not enabled?

    camera.enabled = false;
    camera.fieldOfView = 123f;
    camera.enabled = true;


    Or just set the desired FoV for this camera directly in the Editor.