Locking a texture onto the camera that will always go below everything else rendered

not exactly sure WHICH support catagory to place this in, because the solution (if its possible, and if so can it be done through parts or ui elements) is unknown
but basically imagine a alternative skybox approach where a flat scrolling texture is used instead of a, yaknow, skybox. how would this be done and if so, which way to approach it?
(to those who ask why, its for style :fire::fire::fire:)

I think of Viewportframe

and some in (section) resources, there was topic of alternative way to have skybox through viewportframe

Also SkyboxOrnetation (it’s in beta)

actually that feature exited beta a while ago, anyways i will be trying this

after trying it, the sky just rotates weirdly with the camera and im not sure exactly the issue is
code:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local Lighting = game:GetService("Lighting")

local daft = require(ReplicatedStorage:WaitForChild("daft"))

RunService.RenderStepped:Connect(function() 
	local y, x, z =  workspace.CurrentCamera.CFrame:ToOrientation()
	Lighting.Sky.SkyboxOrientation = daft:Vector3RadiansToDegrees(Vector3.new(y, x, z))
end)

CFrame.Orientation works ?

Did you tried to put Camera’s CFrame Ornietation X, Y, Z

Like this

Vector3.New(Workspace.CurrentCamera.CFrame.Rotation.X, ) -- and on so
-- althought consider using Workspace.CurrentCamera:GetRenderCFrame() which returns "true" CFrame of camera
-- and get from it "true" CFrame's Ornietation of Camera

the hells a CFrame.Orientation

2 Likes

think he meant CFrame.Rotation

i tried rotation before, the x y and z are set to 0 IIRC

I think you have to use Viewport like Skybox (there is some resources in forum) for smooth rotation

Sky.SkyboxOrinetation for having strange behavior (you could post about bug report like why it weirdly rotating)

I believe this is exactly what you’re looking for:

(Somehow remembered there being people trying to figure this out when the skybox rotation feature was added!)

All hail our Luau saviour @egomoose

game:GetService("RunService").PreRender:Connect(function(dt: number)
	local x, y, z = workspace.CurrentCamera.CFrame:ToEulerAngles(Enum.RotationOrder.ZXY)
	sky.SkyboxOrientation = Vector3.new(math.deg(x), math.deg(y), math.deg(z))
end)
2 Likes

to those in the future who wants their skybox spinning (which is what i wanted from here anyways), here’s a quick little code snippet

local Lighting = game:GetService("Lighting")
local sky = Lighting:FindFirstChildWhichIsA("Sky")
local speen = 0
game:GetService("RunService").PreRender:Connect(function(dt: number)
	local x, y, z = workspace.CurrentCamera:GetRenderCFrame():ToEulerAngles(Enum.RotationOrder.ZXY)
	speen += 0.25 * dt
	speen %= 360
	y += speen
	sky.SkyboxOrientation = Vector3.new(math.deg(x), math.deg(y), math.deg(z))
end)
1 Like

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