ReflectionService returns properties and methods that don't actually belong to the class "Part". Like 'shap' or 'siz'

After running this code:

local ReflectionService = game:GetService("ReflectionService")

local ClassName: string = "Part"

local PartProperties = ReflectionService:GetMethodsOfClass(ClassName)
local PartMethods = ReflectionService:GetPropertiesOfClass(ClassName)

local Names: {Name: {ItemType: string}} = {}

--Get list of all the method and property Names
for i, Data in pairs({PartProperties, PartMethods}) do
	for i, Item in pairs(Data) do
		Names[Item["Name"]] = if i == 1 then "Property" else "Method"
	end
end

print("\n\nAll Property and Method names given by reflection Service for", ClassName .. ":\n\n", Names, "\n")

local InvalidMembers = {}

--Test if they are a member of the class
for ItemName, _ in pairs(Names) do
	local success, err = pcall(function(...) 
		print(Instance.new(ClassName)[ItemName])
	end)
	if not success then
		table.insert(InvalidMembers, ItemName)
	end
end

print("\n\nAll Invalid Property and Method names given by reflection Service for", ClassName .. ":\n\n", InvalidMembers, "\n"

I was given this in the output:
I feel like I can’t be missing something since Methods like shap and siz are super odd

All Invalid Property and Method names given by reflection Service for Part:

 ▼  {
                    [1] = "DraggingV1",
                    [2] = "NetworkOwnershipRule",
                    [3] = "Color3uint8",
                    [4] = "formFactorRaw",
                    [5] = "Origin",
                    [6] = "shap",
                    [7] = "Pivot Offset",
                    [8] = "NetworkIsSleeping",
                    [9] = "PredictionMode",
                    [10] = "numExpectedDirectChildren",
                    [11] = "IsInSandbox",
                    [12] = "siz",
                    [13] = "NetworkOwnerV3",
                    [14] = "MaterialVariantSerialized"
                 } 

Expected behavior

I would have Expected to get all of the properties and methods that are ACTUALLY apart of the class requested from the ReflectionService

A private message is associated with this bug report

1 Like

These properties exist, and are used internally, like MaterialVariantSerialized. The weird naming convention is just regular internal property or goofs (for siz and shap).
Pivot Offset is an inteface property, meaning you’re supposed to only edit it through the properties panel.
You should filter for these based on access permission.

2 Likes

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