I have a custom walk animation within my game, but is currently causing alot of problems for me because of how the Arms move. Is there anyway I can keep Character Collisions but disable the Collisions on the Arms? My game is in R6, thank you in advance
Yes you can.
I am pretty sure you can just turn off .CanCollide on each of your arm models.
This is actually from an open sourced script I found a while back. I modified it so that it only disables character-to-character collisions on the arms.
local PhysicsService = game:GetService("PhysicsService")
local Players = game:GetService("Players")
local playerCollisionGroupName = "Players"
PhysicsService:CreateCollisionGroup(playerCollisionGroupName)
PhysicsService:CollisionGroupSetCollidable(playerCollisionGroupName, playerCollisionGroupName, false)
local previousCollisionGroups = {}
local function setCollisionGroup(object)
if object:IsA("BasePart") then
previousCollisionGroups[object] = object.CollisionGroupId
PhysicsService:SetPartCollisionGroup(object, playerCollisionGroupName)
end
end
local function setCollisionGroupRecursive(object)
setCollisionGroup(object)
for _, child in ipairs(object:GetChildren()) do
if child.Name == "Left Arm" or child.Name == "Right Arm" then
setCollisionGroupRecursive(child)
end
end
end
local function resetCollisionGroup(object)
local previousCollisionGroupId = previousCollisionGroups[object]
if not previousCollisionGroupId then return end
local previousCollisionGroupName = PhysicsService:GetCollisionGroupName(previousCollisionGroupId)
if not previousCollisionGroupName then return end
PhysicsService:SetPartCollisionGroup(object, previousCollisionGroupName)
previousCollisionGroups[object] = nil
end
local function onCharacterAdded(character)
setCollisionGroupRecursive(character)
character.DescendantAdded:Connect(setCollisionGroup)
character.DescendantRemoving:Connect(resetCollisionGroup)
end
local function onPlayerAdded(player)
player.CharacterAdded:Connect(onCharacterAdded)
end
Players.PlayerAdded:Connect(onPlayerAdded)
But, why???
canβt you just disable collisions on the arms.
That would disable all types of collisions on the arms, not just character-to-character interaction.
Yes thats the point.
Its supposed to do that.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.