- Home /
The question is answered, right answer was accepted
Depth of field is not working when i build the game (HDRP)
My depth of field is not working when i build the game but it's working while playing in the unity editor. Also other effects are from the same Volume totaly fine in build. I tried to change priotry of Volume but it didn't work too. Should i change somethings on player settings? I'm using 2021.1.7
And this is how i change my depth of field in code:
void focus_item()
{
DepthOfField depthOfField_;
if(volume.profile.TryGet<DepthOfField>(out depthOfField_))
{
depthOfField_.focusMode.value = (DepthOfFieldMode)2;
}
}
I double checked my quality and HDRP settings. I think everything seems fine. Here is my quality settings.
I tried to build game with other post processing effects and all of them work except depth of field.
Go to your quality profile prefab and check "Depth Texture" checkbox.
Answer by AlterMannn · Feb 20 at 12:27 PM
Hi again, thanks a lot for your help. Finally i found the problem. I was using two different depth of fields on my scene. I still don't know why it doesn't support 2 depth of field when i build but i will use only one and will change its properties. I'm developing this game more than one year so i forgot about other depth of field. It took a lot time to remember it haha. Thanks again ^^
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Build Problem, build gives me a blue screen (not BSOD) 7 Answers
Unity android game not working in build. 0 Answers
Triggers not working after building game on mobile 0 Answers