I have a simple question here, how do I make humanoids non collidable? Ive been working with ViewModels lately and the only really big issue is that I want to use humanoid arms for this, when I test it out my character just slowly glides among the floor. Any help on this issue would be very appreciated!
If I understand correctly this should help:
If you have any questions, or would like me to explain further let me know.
1 Like
Thank you very much for the help this saved me a lot of time and, will be very useful for later on.
Here is a quick script that may (hopefully) work:
local ps = game:GetService("PhysicsService")
local players = game:GetService("Players")
-- Parts in the collision group should never collide
ps:CreateCollisionGroup("PlayerCharacters")
ps:CollitionGroupSetCollidable("PlayerCharacters", "PlayerCharacters", false)
-- Add a part to the collision group
local function handlePart(part)
if (part:IsA("BasePart")) then
ps:SetPartCollisionGroup(part, "PlayerCharacters")
end
end
-- Add all of a new character's parts to the group, and add any parts that are inserted later
local function handleCharacter(character)
for _, part in ipairs(character:GetDescendants()) do
handlePart(part)
end
character.DescendantAdded:Connect(handlePart)
end
-- Listen for players respawning to add their characters to the collition group
local function handlePlayer(player)
if (player.Character) then -- if they already spawned in
handleCharacter(player.Character)
end
player.CharacterAdded:Connect(handleCharacter)
end
-- Bind players who may exist before the script runs
for _, player in ipairs(players:GetPlayers()) do
handlePlayer(player)
end
-- Bind any players who join later
players.PlayerAdded:Connect(handlePlayer)
1 Like