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

What script do I use to create a skybox for the planet?

Asked by 3 months ago
Edited 3 months ago

With what script does to create a skybox for the planet, I made a space game I wanted to make it realistic by putting this, example: When entering the planet to change background skybox.

2 answers

Log in to vote
0
Answered by 3 months ago
Edited 3 months ago

From what I understand in your post, you could do the following;

  1. Create a dictionary of all the skyboxes
local Skyboxes = {
    Earth = {
        SkyboxBk = -- Id here
        -- Insert other Earth skybox IDs
    }
}
  1. When the player chooses a planet, grab the values
local Input = script.Parent.Text -- This is an example for getting the planet

if Skyboxes[Input] then

end
  1. Put all of the Id's into their respective properties
game.Lighting.Skybox.SkyboxBk = Skyboxes[Input]["SkyboxBk"]

And do Step 3 for every Skybox slot.

Hope this gives you a pointer in the right direction.

0
Have to put everything inside the module script? gta_12344567890 7 — 3mo
0
That's your choice zboi082007 216 — 3mo
0
Does not work gta_12344567890 7 — 3mo
0
I hope you filled in anything you needed instead of just directly copying zboi082007 216 — 3mo
View all comments (9 more)
0
I filled it all in but I went to test nothing happened gta_12344567890 7 — 3mo
0
If you put it in a module script, you need to call your function in another script zboi082007 216 — 3mo
0
you can send a more explained example I don't know what I do :/ gta_12344567890 7 — 3mo
0
Hello man again I did everything right but there was an error here says: 14:25:08.474 - Workspace.Planets.Mars.Script:42: attempt to index nil with 'SkyboxBk' 14:25:08.475 - Stack Begin 14:25:08.476 - Script 'Workspace.Planets.Mars.Script', Line 42 14:25:08.477 - Stack End gta_12344567890 7 — 3mo
0
That means your skybox doesn't exist, you need to create one zboi082007 216 — 3mo
0
guy can't pass a better example I didn't understand it very well. gta_12344567890 7 — 3mo
0
What better example is there to give other than "Create a skybox" zboi082007 216 — 3mo
0
forget it, i said. Well, it didn't work, I did everything, but there is that error that I already showed you. gta_12344567890 7 — 3mo
0
zboi knows that I wanted to say, in relation to creating skybox for planet, I also meant creating skybox in different areas gta_12344567890 7 — 2mo
Ad
Log in to vote
0
Answered by 3 months ago
Edited 3 months ago

zboi_082007 did I do it right or wrong the script?

I did it that way

local Skyboxes = {
    Eve = {
        SkyboxBk = "rbxassetid://1012890", -- Id here
        SkyboxDn = "rbxassetid://1012891",
        SkyboxFt = "rbxassetid://1012887",
        SkyboxLf = "rbxassetid://1012889",
        SkyboxRt = "rbxassetid://1012888",
        SkyboxUp = "rbxassetid://1014449",
        -- Insert other Earth skybox IDs
    }
}
local Input = script.Parent.Parent.Eve -- This is an example for getting the planet

if Skyboxes[Input] then

end
game.Lighting.Skybox.SkyboxBk = Skyboxes[Input]["SkyboxBk"]
game.Lighting.Skybox.SkyboxDn = Skyboxes[Input]["SkyboxDn"]
game.Lighting.Skybox.SkyboxFt = Skyboxes[Input]["SkyboxFt"]
game.Lighting.Skybox.SkyboxLf = Skyboxes[Input]["SkyboxLf"]
game.Lighting.Skybox.SkyboxRt = Skyboxes[Input]["SkyboxRt"]
game.Lighting.Skybox.SkyboxUp = Skyboxes[Input]["SkyboxUp"]

Answer this question