Issue with parenting player/character model to a folder

How do I parent a player to a folder instead of having them spawn in the workspace? I want to parent them to a folder so it is easier to check all character models for a table (like ignorelists in raycasts), but when I do so the player will refuse to spawn at all.

Unfortunately, you cannot put player objects in folders.

Describe what you mean by “easier to check all character models for a table”, I could help you find an alternative solution for that.

basically, I’m trying to get my raycast to stop detecting humanoidrootparts, but if i include that in the if-then statement for the OnHit function, it won’t try to hit anything else it’ll just ignore everything else (eg "if …hit.Name ~= “HumanoidRootPart”)

so that’s why i wanted to set it up for the ignorelist for the raycast itself instead so it can ignore the rootpart and hit torso instead, but there’s no easy way to find all rootparts for all players, only an easy way for pedestrians since there’s a folder for that

Here is a simple script to find every HumanoidRootPart

local humanoidrootparts = {}

for _, part in pairs(game.Workspace:GetDescendants()) do
     if part.Name == "HumanoidRootPart" then
          table.insert(humanoidrootparts,part)
     end
     -- if you have a lot of parts it's ideal to put a delay here to prevent Studio from crashing
end
1 Like