local PhysicsService = game:GetService("PhysicsService") local forcefield1 = game.Workspace.Collision.WashmachineSepcial.Fenster local forcefield2 = game.Workspace.Collision.MEGAWONDERS.Fenster local forcefield3 = game.Workspace.Collision.Washmachine5.Fenster local crate = game.Workspace.Collision.WashmachineSepcial.Unanchored:GetChildren() local crate2 = game.Workspace.Collision.MEGAWONDERS.minWONDERS:GetChildren() local crate3 = game.Workspace.Collision.Washmachine5.Unanchored:GetChildren() local crate4 = game.Workspace.Collision.MEGAWONDERS.Washmachine1WONDERS:GetChildren() local forceFieldGroup = "ForceFieldGroup" local crateGroup = "CrateGroup" PhysicsService:CreateCollisionGroup(forceFieldGroup) PhysicsService:CreateCollisionGroup(crateGroup) PhysicsService:SetPartCollisionGroup(forcefield1,forcefield2, forcefield3, forceFieldGroup) PhysicsService:SetPartCollisionGroup(crate,crate2, crate3, crate4, crateGroup) PhysicsService:CollisionGroupSetCollidable(forceFieldGroup, "Default", false)
I'm trying to make objects not going through a window but players can go through a window. I'm getting the error - Collision Group does not exist. - Stack Begin - Script 'Workspace.Script', Line 18 - Stack End
Collision isnt a valid member of workspace, so it doesnt exist in workspace, but you could do this:
script.Parent.Touched:connect(function(plr) local player = game.Players.LocalPlayer if plr.Parent.Name == player.Name or plr.Parent.Parent == player.Character then script.Parent.CanCollide = false elseif plr.Parent.Parent == workspace then script.Parent.CanCollide = true end end)