No More Humanoids in Workspace!

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.

4 Likes

I suggest creating a .lua file in your computer and insert the code as scripts can’t run while editing the experience, also SetWaypoint() only works for plugins, and it’s for plugins (you can use the command bar in studio)

1 Like

It is a plugin. A local plugin. It runs whenever you save it as a local plugin, or execute it via Run Script.

3 Likes

I only have little storage

image

also I did post it to the marketplace and modified the code

EDIT: I made a topic recently soo yep

Thank you. It will be more convenient for the community.

Same here:
image
I usually get 250MB left, but this time I’m lucky.

Keep in mind the file is less than 2 KB.

1 Like