I’m tinkering with a first person controller, i’m using an overlaid camera to render the player’s arms.
The main issue with this setup is that i’m unable to grab things (as the arms are always overlaid on top and the FOV may not match) without some trickery (moving the arms to the primary camera during a fast movement, moving the arms out of the screen, perspective tricks, etc).
So what i’m planning is to only draw 1 gameobject (eg: the left arm) using a different field of view, thus allowing me to lerp between the overlay and primary FOVs, making the transition completely seamless.
This means that i need to render all gameobjects with a specific tag with a different field of view, but i have no idea how i’d recognize when i’m drawing it.
So ideally:
Before i render a gameobject i check if it has a tag, if it does i change the fov to a different value, i render the object, then change the fov value back.
Is there any way to do this? Either in URP or legacy (but ideally URP)
The alternative would be to have multiple overlay cameras (so i could move the arm to be rendered by the 2nd overlay camera, then i lerp the FOV and let the arm be rendered by the main camera when i’m done), but the problem with that is that gameobjects currently being drawn by the transition camera will always be below/above everything else.
I could do some shenanigans with depth textures and whatnot, but that’d give me issues with transparent materials (as they don’t draw to depth buffer).
Alternatively i need some way to alter the arm so that it looks like it’s being drawn at a different FOV, but i’m not sure how i’d do that.