I’ve been messing around with collision groups and I have a pre-made group with an object that doesn’t collide with anything.
I want a specific part to collide with it, but it has to be created through a script. That means I also have to create a separate group in my script. How can I reference the pre-made collision group from my script so that I can set these objects to collide with each other?
I’m kind of assuming that the group I created is the one after the default. However, the code below doesn’t work for me.
[17:45:06.702 - Unable to cast value to std::string]
-- Adds beamEnd to beamCollision group
PhysicsService:SetPartCollisionGroup(beamEnd,beamCollision)
local collisionGroups = PhysicsService:GetCollisionGroups()
local invisibleGroup = collisionGroups[2]
PhysicsService:CollisionGroupSetCollidable(beamCollision,invisibleGroup,true)