Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How to make Change sky on Touch Part and back original sky on stop touch?

Asked by 2 months ago
Edited 2 months ago

Someone how to make Change skybox on touch part? I need to make my game. And get back sky on stop touching.

1 answer

Log in to vote
0
Answered by 2 months ago

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

0
thanks gta_12344567890 7 — 2mo
0
np NeonPandaEyes331 19 — 2mo
0
after stop on touch sky change back? gta_12344567890 7 — 2mo
0
you can make a while loop for that, for example while(hit.Parent:FindFirstChild("HumanoidRootPart") do NeonPandaEyes331 19 — 2mo
0
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. gta_12344567890 7 — 2mo
Ad

Answer this question