How to set a player's arms to CanCollide = true?

Hello, how can I do this?

I tried using a RunService.Stepped loop to set the arms to have collision, which worked, but not when colliding with other players.

Collides with the wall for the local player
works

Other players and NPCs
image

CanCollide is true for both models on the server, but false for the other player on the client, so it isn’t replicating to the client properly. Yes, I put the loop in a server script.
Please help

You could look into CollisionGroups.

I would look into Collision filtering

Thanks for the answer, but please explain how collision groups would help me here? I can see how they would if you were trying to, say, make the head have no collision, but arms already have no collision, and collision groups don’t force collision.

1 Like

Look into collision groups. In the mean time, the following may work.

local Game = game
local Players = Game:GetService("Players")
local RunService = Game:GetService("RunService")

local function OnRenderStep()
	for _, Player in ipairs(Players:GetPlayers()) do
		local Character = Player.Character
		if not Character then continue end
		for _, Child in ipairs(Character:GetChildren()) do
			if not (Child:IsA("BasePart")) then continue end
			if not (string.match(Child.Name, "Arm$") or string.match(Child.Name, "Hand$")) then continue end
			Child.CanCollide = true
		end
	end
end

RunService.RenderStepped:Connect(OnRenderStep)

I found my own solution. Thanks anyways!

2 Likes

So what is the solution you found?

Read up on this. I remember I had the exact same issue and this helped me.