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?
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").
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.