Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

The Collisiongroup not found?

Asked by 5 years ago
Edited 5 years ago
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

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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)
0
no offense, but it looks like you just put a bunch of random things together, because it looks really messed up lol User#23365 30 — 5y
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 Lolamtic 63 — 5y
0
i dont get it User#23365 30 — 5y
0
kingdom5 solved it so easily Lolamtic 63 — 5y
View all comments (3 more)
0
i cant do crate1, crate2, and :GetAllChildren() all one by one Lolamtic 63 — 5y
0
all of it looks like properties User#23365 30 — 5y
0
and u dont explain very well lol User#23365 30 — 5y
Ad

Answer this question