Instance.new() vs Studio insert property problem!

Hi, I am having a problem with the Instance.new method. When I do for example Instance.new(“Frame”) it creates a Frame, but the Frame doesn’t have the same properties as when I insert a Frame into the explorer.

As shown in the examples below, the Size and the BackgroundColor3 doesn’t match on the two Frames.

Is there a way to make Instance.new have the same properties as when you insert an object?

Inserted:


Instance.new():

This is most likely a bug since I’m getting this as well. Pretty interesting that nobody found this till now. :eyes:

2 Likes

First time seeing this bug, instead just change the size in the script

1 Like

It’s essential that they have to be the same for my situation. My script checks for objects that get added into workspace and checks if it was inserted by the “editor” (the studio player) by creating a DummyObject with Instance.new and comparing the Properties with eachother.

I think Instance.new() has different default properties for classes than the Insert Object feature. It’s been like this for years already. Some examples are Parts, where they are completely smooth with Insert Object, but still have legacy Studs and Inlets with Instance.new("Part").

1 Like

That is strange that they made it like that. I wonder if there is a workaround to this, and how to do it.

I’m not aware of any workarounds, so I guess we’ll have to settle with manually changing the properties (or in your case, support both defaults).

UI instances don’t really bother me anyways when procedurally making them through code, but Parts are way more annoying since I have to also smoothen surfaces. Hopefully, Roblox will use only one default set of properties per class instead of two.

1 Like