Boolean for Depth of Field working on Studio's Play Test but not the actual game

I made a simple script that keeps a Depth of Field effect disabled while I edit my game on Studio but enables it when playing the game.

Problem is, it works… only in Studio, for some reason it doesn’t work when playing the actual game. I made a simple else if script with some output printing to see what’s wrong.

And it turns out the script works according to the output, but it actually doesn’t…

(Output says it works but it doesn’t)

The local script is placed in game.StarterPlayer.StarterPlayerScripts, I made it local, that way I can add GUI switches to enable/disable this effect later on. I hope this is not what’s causing this problem!

game.Lighting.DepthOfField.Enabled = false

if game.Lighting.DepthOfField.Enabled == true then
	print("Depth of Field Blur has been enabled.")
	print("ERROR: Depth of Field Blur didn't load.")

I believe this is due how your Graphics Quality is set up

By default in Studio, the Graphics “automatically” set your Graphics Level to set your desired specs (I’m assuming) so it’ll always print out the else statement

Having a graphics quality set to more than “8” would consider it to be enabled? I’m not sure

1 Like

My graphics quality are always set to max settings, both in Player and Studio; for Studio I use Vulkan and all set to 21 and for Player I place the slider to maximum quality.

But never mind, I somehow managed to fix it, no idea how ._. thanks for the reply though!