I want to make a game that is purely 2D using only GUI elements. I’m primarily concerned with performance as I don’t want the Roblox engine to waste its resources on rendering characters, cameras, and physics. I know how to disable characters from spawning, but I’m not sure if there is a performance hit induced by the existence of cameras and the physics engine. Has anyone found an optimal way to setup their game for 2D pixel-art engines?
Not exactly sure how to optimize but I do know in order to cover the whole screen and make it purely GUI would be inserting a ScreenGUI.
Just don’t spawn in the character and make sure there’s not much in the Workspace.
Also make sure there are no effects in Lighting.
There’s nothing more you can do beyond that.
The physics engine will do nothing if there is nothing to simulate and the rendering engine will do very little.
if i don’t spawn in the character my uis don’t load, so this solution doesnt work for me.
im gonna resort to just spawning in the character and freezing it or something.
the way im making the player not spawn in is in the Players service, the property called CharacterAutoLoads
and when i have that disabled my uis dont load until i spawn in the player
so can someone help me?
same issue as you. found any solutions?
all of the UIs inside StarterGui
are cloned and reparented to PlayerGui
once you load, so if you don’t spawn in the character they won’t see your UI.
local scripts & ui’s still work if they were in PlayerGui
, but the corescripts just don’t put the UIs there until the player loads, so I made a localscript that you can parent to ReplicatedFirst
if you want to forcefully load the guis:
local StarterGui = game:GetService("StarterGui")
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
function WaitForChildOfClass(parent: Instance, className: string, timeOut: number)
local start = os.clock()
timeOut = timeOut or math.huge
repeat
task.wait()
until parent:FindFirstChildOfClass(className) or os.clock - start > timeOut
return parent:FindFirstChildOfClass(className)
end
local PlayerGui = WaitForChildOfClass(LocalPlayer, "PlayerGui")
for _, Gui in StarterGui:GetChildren() do
Gui:Clone().Parent = PlayerGui
end
you can use this as a workaround, I’m not sure if ROBLOX will ever change this behavior, so I think it’s future proof enough.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.