Why does flashlight don't works from 4.14 to 4.17 project?

I dont think visibility is really the way you want to go. you could try using set hidden in game which should work for when your in the game. Alternatively you could just set the lights intensity.