Over the months of seeing people on the DevForum have issues, I consistently see people “accidentally” having humanoids in workspace. Issues like lag and raycast inconsistencies are present when a Humanoid is in workspace. They usually make a post about it on the DevForum, and then solve it after finding out there’s a humanoid in workspace. The people who don’t find out there’s a Humanoid in workspace have a worse time.
That’s why this resource can help with that.
The reason why humanoids appear in workspace is because a team member, or you, ungrouped a rig with a humanoid inside of it. It’s likely a “Sizing Dummy”.
So, here’s how to install it.
-
Create a Script (anywhere)
-
Paste this code:
local changeHistoryService = game:GetService("ChangeHistoryService")
function check(c)
if c.ClassName == 'Humanoid' then
task.wait(.5)
if c.Parent ~= workspace or c:FindFirstChild('noDelete') then return end
for _, children in c:GetChildren() do
print('Reparenting Humanoid.'..children.Name..' to lighting.')
children.Parent = game:GetService('Lighting')
end
print('A Humanoid in workspace was detected and deleted.')
c.Parent = nil
--Allow the user to undo the action.
local bv = Instance.new("BoolValue")
bv.Name = 'noDelete'
bv.Archivable = false
bv.Parent = c
changeHistoryService:SetWaypoint('HumanoidInWorkspaceDeletion')
end
end
for _, child in workspace:GetChildren() do
check(child)
end
workspace.ChildAdded:Connect(check)
-
Now, right click on the script. Click “Save as Local Plugin…”
-
Done!
Features:
- Removes a Humanoid from Workspace
- Allows you to temporarily “undo” the action (until you save the place and open it again). Because of Roblox, it cannot undo ungrouping functionality.
- Waits half a second before performing the operation in case another plugin is trying to use a Humanoid in Workspace to interact with something.
Do not expect this plugin to be updated frequently. That’s why I didn’t publish it to the marketplace. I will release a fix if something breaks.
Please note that this plugin will not install itself to all of your devices. You will manually have to complete this operation for all of your devices if you want the plugin installed on them.
As a developer who has had 5 years of experience on the platform, I feel this shouldn’t even be necessary. However, my expectations for the common Roblox builder (in terms of organization) were too high. I’m not a builder myself, and I’m astonished with what they can accomplish, but I’m assuming the main problem is that they don’t keep the explorer window open.
Also, yes, there’s going to be MANY commenters below saying this isn’t necessary, and I can agree. However, it’s quite a convenience for certain developers who have these types of issues, which is why I spent 30 minutes making this resource.