As a Roblox developer, it is currently too hard to see the true values of ObjectValues. This makes it difficult to get a visual idea of what’s going on in Studio and reduces the usefulness of the Explorer.
[Check the solution to get a better idea of why this is happening!]
Original/Incorrect View of Why This Occurs
Here is a piece of example code to show the issue:
Code
local TweenService = game:GetService("TweenService")
local Workspace = game:GetService("Workspace")
local OBJV = Instance.new("ObjectValue")
OBJV.Name = "OBJV"
OBJV.Parent = Workspace
print(type(OBJV.Value))
local ExampleTween = TweenService:Create(Workspace.Baseplate,TweenInfo.new(1), {Color = Color3.fromRGB(255, 255, 255)})
OBJV.Value = ExampleTween
print(type(OBJV.Value))
OBJV.Value = Workspace.Baseplate
print(type(OBJV.Value))
The output of the code looks like:
When opening up explorer (where the issue is), the ObjectValue’s default Value (when Value = nil
and nothing has been assigned) is:
When the ObjectValue’s Value is set to the Tween, it looks like:
Identical
Finally, when the ObjectValue’s Value is set to the Baseplate, it looks like:
The issue is that there is no visual difference between when ObjectValue’s value is nil
or assigned an Instance like Tween which has no Name property. If I was looking purely at explorer to test the code above, it would look like the the value of the ObjectValue does not change until I assign it the Baseplate instance, which is an incorrect and flawed representation of what is actually happening.
My proposed alternative
Currently it seems that the visual value of the ObjectValue is the Name property of the instance (even though it’s actually the instance itself). If there is no Name property for the instance, the type of the instance should be added instead. This would fix the issue, for (in my example) the ObjectValue’s value, when assigned a Tween, would display as:
.
If this issue is addressed, it would improve my development experience because the behavior of ObjectValues, in explorer, would more accurately resemble what is going on in the game The value of an ObjectValue should only appear empty when it is empty. When the value is assigned to an object, it must represent the object in some capacity rather than simplying appearing as if nothing is there. This would be a studio only fix, as this is really about modifying how Explorer represents ObjectValue values.