How to make artificial sunrays from parts?

I’m working on a project and was wondering how I would be able to make a “sunray” effect from parts, similar to the one in Starscape. More specifically, I’m trying to make a physical star with these characteristics. It’s clearly possible, I just don’t know how to achieve this.

I’ve tried searching the web and forums but couldn’t find anything related.

Starscape star: https://gyazo.com/2b5ca488e777a34335daa90203c34941

I’m also not sure whether to put this topic in the art section or keep it here.

3 Likes

If you are talking about the fast-moving rays of light moving backwards, that can be done with a beam and a texture.

If you are talking about exactly this glow
image

then that’s just camera trickery.

It was done by changing the lighting suns geographical latitude and clock time dynamically to make it look like its moving, to sell this effect a part was placed between the camera position and the suns position with the distance slowly increased and decreased to give a sense of depth.

If you want to do this you will need to fiddle around with the values a whole lot to make it look convincing, but if you want to give it a shot, here you go.

Here’s an example of what it looks like in-game
https://medal.tv/games/roblox-studio/clips/bdFBfg3DUN4g_/d1337Ubu1fAR?invite=cr-MSxWY20sMTA5MDczNTYs

The code used is here

-- localscript
game:GetService("RunService").RenderStepped:Connect(function()
	game.Workspace.FakeSun.Position = game.Workspace.CurrentCamera.CFrame.Position + game:GetService("Lighting"):GetSunDirection() * 30
end)

-- 30 is the distance in studs the fake sun object is offset from the camera.
-- this is the value you should change to make your sun go closer or further away

( Lighting:GetSunDirection )

You can only have this effect “on” a single part at once, and the lighting has to have a SunRaysEffect instance in it, you can add by right clicking the lighting, pressing insert object, and inserting SunRaysEffect.
image

I hope this helped and is what you were looking for, good luck with whatever it is you are making.

5 Likes