Addition Of A New Symlink Instance

This feature request will be split into multiple parts outlining the problem, alternate solutions, and an explanation for the proposed change.

The Problem

As a Roblox developer, it is currently too hard to navigate to Roblox instances in large games using scripts without it looking like a jumbled mess. Let’s say you are trying to access clock hands on a wall in a large, complicated post-apocalyptic city map. The following code may suffice, but it is long and wordy:

local HourHand = workspace.City1.DistrictA.Buildings.Schools.GreenvilleHigh.Clock.HourHand
local MinuteHand = workspace.City1.DistrictA.Buildings.Schools.GreenvilleHigh.Clock.MinuteHand

You might suggest using a variable to store Clock, as so:

local CityClock = workspace.City1.DistrictA.Buildings.Schools.GreenvilleHigh.Clock
local HourHand = CityClock.HourHand
local MinuteHand = CityClock.MinuteHand

However, even with this addition, the code still does not look as clean as it could be.

If this issue is addressed, it would improve my development experience because a Symlink instance would allow you to navigate to specific Instances as simple as the following:

local Symlink = workspace.GreenvilleHighClock -- typeof: Symlink, inherits Instance 
local HourHand = Symlink.HourHand
local MinuteHand = Symlink.MinuteHand
This demo is not meant to be a proposed solution but rather a demonstration of how it is a better alternative to variables.

In our abandoned city example, the clock is the only moving object and we don’t have to worry about accessing anything else in the city with a script. Our Symlink makes it substantially easier to access the clock hands.

The Current Solution (?)

One solution that comes to mind is ObjectValues. You can easily create an ObjectValue and set the child to the Instance you wish to symlink. In theory, this can achieve the exact same end result as a Symlink, as the Value property of the ObjectValue points to the actual Instance, allowing you to modify it using scripts as you normally would.

The issue with this method is that you are sacrificing Symlinks’ potential for a subpar solution. In our fictitious world, let’s say we would like to create a new hand on the clock, the seconds hand. Using our Symlink, we could use the following code to do so,

local Symlink = workspace.GreenvilleHighClock -- typeof: Symlink, inherits Instance 
local SecondHand = Instance.new("Part", Symlink)

as opposed to:

local ObjectValue = workspace.GreenvilleHighClock_Value
local SecondHand = Instance.new("Part", ObjectValue.Value)
-- I understand that using the Parent argument in Instance.new()
-- is inefficient, but this is an example snippet of code

In addition, the Value property of a ValueBase is, at the end of the day, still a property. You cannot use the circular plus button in the Explorer tab on ObjectValue.Value to add children Instances to the target. You cannot modify the Instance’s properties from Explorer using ObjectValue.Value. With a Symlink, these actions would theoretically be possible as it mirrors the target Instance.

The Conclusion

At this point, it is all about convenience. If you have no issue with using a top-level ObjectValue to create a mock symlink, then you can ignore this post. There is no pressing need for this to be added, but it would be beneficial in my opinion as a quality-of-life upgrade. I’m sure this post will garner a lot of criticism, and this may not be a well-thought-out feature request, but it may benefit certain use cases and could be a help to many people.

8 Likes

A good solution is CollectionService:

local CollectionService = game:GetService("CollectionService")

-- fetches all objects tagged with "Clock"
for _, Clock in CollectionService:GetTagged("Clock") do
     -- run your Clock script here
end

Although tags could solve the example scenario, the proposed Symlink would be interactive in the Explorer tab and therefore needs to be an Instance (see attached). It would be similar to a Roact portal in functionality but have the appearance of a Model/Folder.

image

Support.

I feel like using base values to hold objects is just kind of clunky. At least an object attribute or this could solve most of my problems, and base values could be deprecated entirely.

would be amazing, i currently need something similar and its annoying to not be able to use it