Axolotleless

Custom sun and moon models for: (Silly character gaem)

Feb 4th, 2025 (edited)
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.56 KB | None | 0 0
  1. local SOLAR_DIST = 512
  2.  
  3. local sun = workspace.SunDude
  4. local moon = workspace.Moonette
  5. --Call this function either every frame or every time the ClockTime changes
  6.     local function updateSunAndMoon()
  7.        
  8.         local sDir = game.Lighting:GetSunDirection()
  9.         local mDir = game.Lighting:GetMoonDirection()
  10.        
  11.         local origin = CFrame.new(workspace.CurrentCamera.CFrame.Position)
  12.        
  13.         sun:PivotTo(origin + SOLAR_DIST  * sDir)
  14.         moon:PivotTo(origin + SOLAR_DIST  * mDir)
  15.        
  16.     end
  17.     updateSunAndMoon()
  18.    
Advertisement
Add Comment
Please, Sign In to add comment