As a fix for this,
TagEditor > Plugin > Components > WorldView > WorldProvider
If a primarypart still wasn’t found after going through the Model’s GetChildren, go through the Model’s GetDecendants then.
for obj, _ in pairs(self.trackedParts) do
local class = obj.ClassName
if class == "Model" or class == "Folder" then
local primary = obj.PrimaryPart
if not primary then
local children = obj:GetChildren()
for i = 1, #children do
if children[i]:IsA("BasePart") then
primary = children[i]
break
end
end
if not primary then --really dig for an item to attach to...
local children = obj:GetDescendants()
for i = 1, #children do
if children[i]:IsA("BasePart") then
primary = children[i]
break
end
end
if not primary then
warn("No primary item was found for "..obj:GetFullName())
end
end
end
if primary then
local entry = {
AngularSize = partAngularSize(primary.Position, obj:GetExtentsSize()),
Instance = obj,
}
sortedInsert(newList, entry, sortFunc)
end
Edit: Unless that it is exactly intended to only collect it’s own items inside the Model as the Collection, I instead rather treat everything inside a Model Collection as belonging to that collection.
To also fix the ToolTip, the info of the hovered over model’s Collection
Tag Editor > Plugin > Components > TooltipView
after “for _i = 1, 10 do”, if a Collection hadn’t yet been found, then try checking through the first RayCast .Parents
--if a setState wasn't found, check what the mouse is hitting
-- and scroll through the Raycasted parents until hit workspace or no parent
if not part then
local mouse = UserInput:GetMouseLocation()
local ray = camera:ViewportPointToRay(mouse.X, mouse.Y)
local params = RaycastParams.new()
params.IgnoreWater = true
params.FilterType = Enum.RaycastFilterType.Blacklist
local direction = ray.Direction.Unit * 1000
local cast = workspace:Raycast(ray.Origin, direction, params)
local result = cast and cast.Instance
if result then
local parent=result;
for _i = 1, 20 do
if parent==game or parent==workspace then
break
end
parent=parent.Parent; --loop out of the parent of the currently selected item.
local parentTags = Collection:GetTags(parent)
if parentTags and #parentTags > 0 then
part = parent
tags = parentTags
break
-- future suggestion is to probably check
-- for MULTIPLE collections that the part
-- is probably inside of.
end
end
end
end
end
self:setState({
Part = part,
Tags = tags,
})
Example of what this fixes when the Model is the only one in the ‘Collection’ with its following Children and Decendants
before
after