From this article, you will learn how you can make a permanent and very long night in Roblox Studio. And we will also analyze some tricks that will allow you to make a rapidly changing time of day.
How to Make a Very Long Night in Roblox Studio
First of all, you need to change the time of day. To do this, click on Lighting, and in the bottom panel, in the Data tab, change the TimeOfDay line. Set any night time, for example, 23:30.
After that, the day will be replaced by night and the moon will appear in the sky.
Then hover over Workspase, press the Buttons in Roblox Studio and add a script (for a quick search, enter Script in the search bar).
Click on Script and paste this code into it:
while wait(10000) do
game.Lighting:SetMinutesAfterMidnight(game.Lighting:GetMinutesAfterMidnight()+1)
end
Done, you will have an almost endless night.
RELATED: How to Add Music in Roblox Studio
How to Make a Rapidly Changing Time of Day
In order to make a rapidly changing time of day (day and night will last a few seconds), you need to attach the Script to the Workspase in the same way as in the previous example and paste this code into it:
while wait(0.00001) do
game.Lighting:SetMinutesAfterMidnight(game.Lighting:GetMinutesAfterMidnight()+1)
end
In this case, night and day will replace each other very quickly. This trick can come in handy if you want to make a cool map.
Published: May 11, 2022 06:52 am