How to make the sky spin and loop like that using SkyboxOrientation

how to make the sky spin and loop like that using SkyboxOrientation (to west and south)

1 Like

Like what? :skull:

Summary

Char limit
What do you expect to see here btw?

like amm the sky to spin using the SkyboxOrientation

Just do:

local Lighting = game:GetService("Lighting")
local RunService = game:GetService("RunService")
local Sky = Lighting:WaitForChild("Sky")::Sky

local AddPerSecond:Vector3 = Vector3.new(30,0,0)
RunService.PreRender:Connect(function(delta:number):()
	Sky.SkyboxOrientation+=AddPerSecond*delta
end)

Obviously in a Client run context or a LocalScript

1 Like

To make a sky object rotate horizontally alter its SkyboxOrientation property along the Y (yaw) axis. Changing the X (pitch) and Z (roll) values from zero will induce vertical rotation. In my current project, I accomplished this like so:

--localscript
local CLOUD_SPEED = 1
RunService.Stepped:Connect(function()
  local t = os.clock() --other time functions work just as well
  Sky.SkyboxOrientation = Vector3.new(0, ((t * CLOUD_SPEED) % 360), 0)
end)

Why do you reinvent the wheel (deltatime)? RunService | Documentation - Roblox Creator Hub :skull:

I’m not sure how this is reinventing the wheel when time functions like tick() have been used in much the same manner throughout Roblox’s history. Regardless, delta time is not a timestamp - os.clock() is. This makes the code deterministic: given the same timestamp and configuration, the resulting skybox orientation will be identical.

1 Like

oh right i forgor about that becouse i were busy writing smth while giving this solution.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.