I am very new to coding (And Dev Forums), I am making a tower defense game, But I am having issues with the little guys colliding with each other, I tried following tutorials with the answer being:
for _, v in pairs(LittleFella:GetChildren()) do
if v:IsA("BasePart") then
PhysicsService:SetPartCollisionGroup(v, "Awesome Squad") -- collision group here
end
end
But it doesn’t really work for some reason, The enemy’s / zombies use r6.
A part of the script I am currently using for the zombie spawns:
-------------------------------------------------------------------------------------------------------------------------------------------------------------|
local PhysicsService = game:GetService("PhysicsService")
local EnemyFolder = game.ServerStorage.Enemy
local CurrentWave = game.ReplicatedStorage.GameValues.CurrentWave
local PlayerMoney = game.ReplicatedStorage.PlayerValues.Money
local EnemyCount = game.ReplicatedStorage.GameValues.EnemyCount
local GameEnemy = game.Workspace.Enemy
MoneyToGive = 0
-------------------------------------------------------------------------------------------------------------------------------------------------------------|
local function BasicSpawn()
local Basic = EnemyFolder.Basic:Clone()
Basic.Parent = GameEnemy
for _, v in pairs(Basic:GetChildren()) do
if v:IsA("BasePart") then
PhysicsService:SetPartCollisionGroup(v, "Enemy")
end
end
end
local function FastSpawn()
local Fast = EnemyFolder.Fast:Clone()
Fast.Parent = GameEnemy
for _, v in pairs(Fast:GetChildren()) do
if v:IsA("BasePart") then
PhysicsService:SetPartCollisionGroup(v, "Enemy")
end
end
end