Improve Explorer Visualization of ObjectValue Values

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:
image

When opening up explorer (where the issue is), the ObjectValue’s default Value (when Value = nil and nothing has been assigned) is:
image

When the ObjectValue’s Value is set to the Tween, it looks like:
image
Identical

Finally, when the ObjectValue’s Value is set to the Baseplate, it looks like:
image


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:
image.

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.

1 Like

This seems more like a bug with TweenService:Create than a deficiency of the ObjectValue value visualization. Why do you propose solving it this way rather than by making tweens be created with a non-empty name?

That’s a great question, and it actually enabled me to get a better understanding of what’s actually occurring by playing around more with the ObjectValue.

I made a mistake in my original post, which was believing that Tweens do not have a name property. That is false, they do - although I think no one ever has a reason to really use it. What I realized, after messing around with different instances and their parents (which is the true independent variable), is that an ObjectValue will only display the name property of an instance if the viewpoint can see the parent.

If I assign any instance to the ObjectValue’s value and set it to Workspace (for example), I will be able to “see” it: i.e. it won’t look like
image

I will be able to “see” it regardless of whether I am looking at this as the Client or the Server in Studio.

If I assign the instance’s parent to something like ServerStorage, I won’t be able to “see” it as the Client, but I can “see” it when viewing it as the Server.

If I create an Instance, either with Instance.new(), or TweenService:Create() as I was using before, neither Client nor Server will be able to “see” the value of the ObjectValue (however, they will still be able to reference the ObjectValue’s value property and manipulate the instance from there).


Same problem but for a different reason than I originally thought. At least within Studio, developers should be able to see the Name properties of instances assigned to ObjectValue’s regardless of where the parent is. Same as before, this masks and incorrectly displays what is actually going on in Studio, makes it difficult to get a visual idea of what’s going on, and reduces the usefulness of Explorer. 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 simply appearing as if nothing is there.

[Thank you so much for the question! I knew there was an issue, but I’m glad to see what the actual cause seems to be.]

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