Someone how to make Change skybox on touch part? I need to make my game. And get back sky on stop touching.
✓ ANSWER ACCEPTED
How to make Change sky on Touch Part and back original sky on stop touch?
1 answer
✓ Accepted answer
first, you will need a touch script so the script can activate when you touch it
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("HumanoidRootPart") then
you can use this to find if the item touching the part is a real thing
then you can create a new skybox using instance.new
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("HumanoidRootPart") then
local skybox = Instance.new("Sky")
skybox.Parent = game.Lighting
--add textures below
end
end)
you can add the skybox textures yourself next
This discussion is preserved as it was. New answers, comments, and votes are closed.

5 comments
thanks
np
after stop on touch sky change back?
you can make a while loop for that, for example while(hit.Parent:FindFirstChild("HumanoidRootPart") do
could you also tell me which script to change sky value after entering the planet for example. Im creating space game with planets, everything else, I wanted to know which script changes the sky after entering a planet, as if it were an atmosphere transition.