Doors like dark room system

  1. What do you want to achieve? I want to make doors like dark room system.
    I put an invisible part in a room with touch event.
    When the player touch the part, that put a black color correction effect and put a black fog.
    When the player don’t touch it anymore, that remove the color correction effect and the fog.
local dark = Instance.new("ColorCorrectionEffect")
dark.Parent = workspace.CurrentCamera
dark.Brightness = -0.01
dark.Enabled = false


function enter()
	dark.Enabled = true
	for i = -game.Lighting.FogStart, 10, 1 do
		game.Lighting.FogStart = -i
		game.Lighting.FogEnd = 100-i*8
		dark.Brightness = -i/1000
		if dark.Enabled == false then
			leave()
			break
		end
		wait(0.03)
	end
end
function leave()
	game.Lighting.FogStart = 0
	game.Lighting.FogEnd = 100
	dark.Brightness = -0.01
	dark.Enabled = false
end

darkroomEnter.OnClientEvent:Connect(function()
	enter()
end)
darkroomLeave.OnClientEvent:Connect(function()
	leave()
end)
  1. What is the issue? There are 2 problems…

  2. You can see the room entirely when you are outside the room : I have no idea how to only hide the room.

  3. When you equip a tool, the touchend event trigger.

  4. What solutions have you tried so far? I Didn’t find any Solution on the studio about doors dark rooms

This is my first time asking on the forum so If I’m not clear, tell me.
This is a video of the issue :
dark room.wmv (1.3 MB)

1 Like

i’m fairly sure DOORS is actually pitch black but the lights all around the room is what makes you able to see
you’d most likely have to do the same thing but disable the lights in rooms that are supposed to be dark

Yeah I Understand what you mean but I making a game without lights. Yeah I know Its a bit weird.
In classic doors, I think there is the same bug that you can see through the room when you are outside.
If you can find a solution for the tool equipping bug, that would be good.

1 Like

if your game has no lights why would you even need a dark room

what tool equipping bug??

Yeah I don’t know what I did that. I wanted to make the game harder.

a small bit weird that i can see stuff around in the first room and the last room but you said there’s no lights
just do the same thing? disable lights from the rooms that are intended to be pitch black and you’re done?

For the tool bug, is that when you equip a tool, the touchend event trigger so the room become light and come dark progressively.
That happened not only to dark room

If you see on the video, when I equip the lantern, the room become light…

yeah so i’m pretty sure if you do it the exact way doors did it that would fix itself
wouldn’t it
(unless i got something wrong)

But do you know the way?
What is it?

1 Like

yeah, the lights on the walls in DOORS are the reason you can see and can’t in dark rooms.
you simply have to disable the lights (if there are lights in the room, i guess) if it’s a dark room so that you can’t see without any light sources

In doors, I think there is another option to see close to you. Its why I used fog.
In my Game, I use the moon light to light the room.
Do you think Its better If I put lights in every rooms I have and disactivate the light when the player enter if Its a dark room?
Sorry If I annoy you.

1 Like

yeah
the reason you can see in DOORS is because there’s a light around you (i’m assuming) that makes you able to slightly see in the dark

Ok, so I will disable the basic lightning, put light in every rooms.
To put the light, I need to put a player added event to put a point light in the humanoid root part of the character?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.