Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to change skybox (locally) after touching a block?

Asked by 3 years ago

I want to create another area in the map for my game, but that area is always night so I need a separate skybox. I think it's easier to make the skybox change if I touch a block, but if there's a different method that works better please tell. Every tutorial I've found for this doesn't work for some reason, maybe because they're out of date? Any help is greatly appreciated.

1 answer

Log in to vote
0
Answered by 3 years ago

Assuming you already have a sky stored somewhere you can just do this:

local Sky = game.Workspace.Sky

-- This is just a script that changes the sky when a part is touched, you can use any function you like.

script.Parent.Touched:Connect(function()
local Clone = Sky:Clone()

Clone.Parent = game.Lighting
end)

Haven't tested this but it should work.

Ad

Answer this question