Collision groups wacky behavior

I was coding tank collision groups so the turret doesn’t get stuck on itself,

local name = "Vehicle"..tostring(i)
ps:CreateCollisionGroup(name)
ps:CollisionGroupsAreCollidable(name,name,false)

for _,part in pairs(vehicle:GetDescendants()) do
	if part:IsA("BasePart") then
		ps:SetPartCollisionGroup(v,name)
	end
 end

No error, of course. This bit is taken out of a larger script.

Collision groups seemed to not take effect however, because i tested it with this code above commented out, and with it in and there is zero difference. Here is the problem:

It isn’t getting stuck on the character in the turret, or it is, but either way the character is added to the collision group later in the code

Im assuming it has to do with this:

ps:CollisionGroupsAreCollidable(name,name,false)
1 Like

Use CollisionGroupSetCollidable() insead :slight_smile:

Another victim of the documentation…

1 Like