Hello, Currently Im trying to make a football throw system, but Im trying to change the collision groups because when i throw it it collides with the player so I made a script that sets the players parts to that collision group. The characters shouldn’t collide with the group “Football” but it does. Here’s the Groups
script:
local PhysicsService = game:GetService("PhysicsService")
local Players = game:GetService("Players")
local function onDescendantAdded(descendant)
-- Set collision group for any part descendant
if descendant:IsA("BasePart") then
descendant.CollisionGroup = "Characters"
end
end
local function onCharacterAdded(character)
-- Process existing and new descendants for physics setup
for _, descendant in pairs(character:GetDescendants()) do
onDescendantAdded(descendant)
end
character.DescendantAdded:Connect(onDescendantAdded)
end
Players.PlayerAdded:Connect(function(player)
-- Detect when the player's character is added
player.CharacterAdded:Connect(onCharacterAdded)
end)
heres a video:
(sorry for the first throw sometimes it doesn’t collide at all)
any help appreciated!