Hello all, I’ve run into a issue with the collision filtering. I have set up 2 groups and made them not collide : Mortar and MortarProjectile (See picture below)
Than, I add the parts to those groups
for _, part in ipairs(self.Instance:GetDescendants()) do
if part:IsA("BasePart") then
PhysicsService:SetPartCollisionGroup(part, "Mortar")
end
end
And the projectile itself (I add many since they get spawned every 4 seconds, but they get destroy some time after)
local projectile = MortarProjectile:Clone()
PhysicsService:SetPartCollisionGroup(projectile, "MortarProjectile")
Now, this should make the projectile not collide with any part of mortar, but for some reason it does. The touch event get triggered and the hit
is a mortar part.
projectile.Touched:Connect(function(hit)
print(hit) -- This gives the mortar part, which it shouldn't since they can't collide.
...
projectile:Destroy()
end)
I also print the part where I add the mortar part to the mortar collision group, and all get printed so it is okay. I should also mention that some of the parts have already can collide set to false but I think it doesn’t change anything. What could be the issue here?