Real Time Legacy Outlines in Studio

For a game that I’m working on, I thought about the old Legacy Outlines feature that has been deprecated for years ago. I decided to use the command bar (this can be done in a regular script if you would rather have outlines only in game) and use Roblox’s attributes feature to play around with how I can recreate outlines.

This is the code that I have ran in the command bar (again this can be done in a regular script if you’d like)

if game.Lighting:GetAttribute("LegacyOutlines")==nil then
	game.Lighting:SetAttribute("LegacyOutlines",true);
end;
while task.wait()do
	if game.Lighting:GetAttribute("LegacyOutlines")==true then
		for _,Part in workspace:GetDescendants()do
			if Part:IsA("Part")and Part.Shape==Enum.PartType.Block then
				if not Part:FindFirstChildOfClass("SpecialMesh")and not Part:FindFirstChildOfClass("BlockMesh")and not Part.Parent:FindFirstChildOfClass("Humanoid")and not Part:FindFirstChild("LegacyOutline")then
					local Outline=Instance.new("SelectionBox");
					Outline.Parent=Part;
					Outline.Color3=Color3.fromRGB(102,102,102);
					Outline.LineThickness=0.001;
					Outline.Transparency=0.8;
					Outline.Name="LegacyOutline";
					Outline.Adornee=Part;
				end;
			end;
		end;
	else
		for _,Part in workspace:GetDescendants()do
			if Part:IsA("Part")and Part.Shape==Enum.PartType.Block then
				if not Part:FindFirstChildOfClass("SpecialMesh")and not Part:FindFirstChildOfClass("BlockMesh")and not Part.Parent:FindFirstChildOfClass("Humanoid")and Part:FindFirstChild("LegacyOutline")then
					Part:FindFirstChild("LegacyOutline"):Destroy();
				end;
			end;
		end;
	end;
end;

Keep in mind that running this in the command bar will not rerun next time you open the game and it’s far better to run this in a regular script. But you can run it in the command bar if you want to see the outlines in real time without running the game.

Feel free to use this (I might make a model of this for the toolbox)

Does this work on cylinders, wedges an cwedges?

Edit: It doesn’t :,(

1 Like

I had originally done this exact thing but with highlights instead of selection boxes.
The thing that I noticed about selection boxes that highlights don’t is keep consistency with the lighting.

Example:
Highlights are the same brightness, no matter the lighting conditions

Selection boxes will keep consistency with the lighting properties. Ex: Putting the ambient property at (0,0,0) will make the selection box go dark, which highlights don’t.
The original outlines would change the darkness of them based on the lighting properties and highlights don’t do that.

If I were to use highlights then it would work for any shape. But since highlights do that, I don’t want to use them.
You can modify the script to use highlights instead so that it works with any shape.

I do wish Roblox added a property to highlights to change how much they glow because that would make this better.

Edit:
Also, highlights don’t have a property for thickness which is also why selection boxes are better to use for this.

Still looks kinda off but cool anyway, maybe you should also add very small random color change to parts too, as legacy outlines did that for some reason.
(Colors randomly get a bit darker or brighter)

1 Like

I think I remember seeing that happen with them. I plan to make this a free model so I can do this in addition (and maybe add some configurations to it for those who want to)

If only roblox made selection boxes adapt to cylinders an wedges.
Like making it so that you can change the shape of it whenever you like to.

1 Like

Roblox’s selection sphere is so stupid like it’s nothing at all like selection box

if yk yk