Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

The Collisiongroup not found?

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

1 answer

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)

7 comments

0

no offense, but it looks like you just put a bunch of random things together, because it looks really messed up lol

0

No! The big washmachines are in the model collision and i dont want people to stay at door and let everything out just to camp

0

i dont get it

0

kingdom5 solved it so easily

0

i cant do crate1, crate2, and :GetAllChildren() all one by one

0

all of it looks like properties

0

and u dont explain very well lol

This discussion is preserved as it was. New answers, comments, and votes are closed.