Planetary atmospheres on Roblox

Okay, I want to make this clear now since I have a feeling if I don’t address this, more questions following the same pattern will appear.

Many times people get asked to be provided with a finish product. I completely understand that you, @NascarDriverBurak101 want to fix the issue you are having as fast as possible but a quote I learned, “Learning a person to fish will help more than to give that person a fish” is why I’ve not provided a finished product and just the atmosphere script.

I will not provide a earth model as the instructions that I will list again down below is made sure to be clear and simple to follow.

  • Begin by inserting the model, then following the instructions inside the model
  • Then to render atmospheres you start by Inserting a local script into StarterCharacterScripts
  • After that copy and paste it inside the newly added local script

! MAKE SURE THAT THE PARENT OF THE GLOBE IS A BASEPART !

Local Script - COPY & PASTE
local AtmosphereService = require(game:GetService("ReplicatedStorage").AtmosphereService) -- Gets module script responsible for AtmosphereService

local Atmosphere = AtmosphereService.NewAtmosphere(game.Workspace:WaitForChild("Earth"), 40, 400, .4, Color3.fromRGB(182, 194, 249), Color3.fromRGB(185, 255, 233)) -- Instances a new atmosphere

--[[ !WHEN CREATING ATMOSPHERES REMEMBER!

The first variable requires the parent for the atmosphere

The second variable explains the size of the atmosphere

The third variable explains the amount of 2D layers should represent the gradient sphere

The fourth sets the transparency of the atmosphere

The fifth variable explains the color and the last variable explains what color the transition from bright to dark there shall be.

]]

game:GetService("RunService").RenderStepped:Connect(function()
	AtmosphereService.UpdateAtmosphere(Atmosphere) -- Crutial for generating the shadows
end)

If you have any further problems that you’d like to discuss I’m happy to walk you through, thanks.

1 Like

I seem to have gotten it working, but is the interior supposed to be visible? I tried looking on the inside, but it’s extremely foggy.

1 Like

Great that it’s starting to work!

For now the “interior” is not something you’re supposed to view, I’m hoping in the future I can work on the fact that it becomes extremely foggy when approaching the denser regions (or otherwise the centre) of the atmosphere but for now this is what happens.

If you want a object to be semi-visible but still foggy because of the atmosphere you scale the sphere to be close to the size of the atmosphere, not exactly although as that will in all cases fully obscure the atmosphere.

You can increase the transparency to be somewhere around .95 if you want a very see-through atmosphere which will in turn probably fix the issue you are mentioning.

Hope this answers your question and I wish you the best of luck in your game :wink:!

1 Like