Waiting for light from Spotlight / Pointlight to render

The opening scene of my game requires Roblox lighting objects (Pointlight, Spotlight, etc.) to render before giving the player visuals. I already have a loading screen set up that waits for the actual instances to load and then gives a buffer second before revealing the scene, but the lighting objects tend to render a second or two after the scene is revealed.

Is there a way I can wait for the visual effects from the Spotlights / Pointlights to render on the client before revealing the scene? I haven’t found any events or services that have this functionality.

You’re in luck my friend, Roblox has added a new way of doing that. First get the player in the sever as the client doesn’t work. Then after getting the player you want, you could use the PlayerAdded event and then get the player, idk. Define the player, then use the new AddReplicationFocus(BasePart), base part here being the part that renders in everything for the player.

It should look something like:

local Players = game:GetService("Players") -- < You don't need this method, you could get the player using even a remote event.
Players.PlayerAdded:Connect(function(player)
	local PartThatRenders = workspace:FindFirstChild("PartThatRenders") -- < Change it to whatever your part's name is.
	player:AddReplicationFocus(PartThatRenders) -- < Remember to have the part near the stuff you want to render.
end)

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