local o=game:GetService("\080\104\121\115\105\099\115\083\101\114\118\105\099\101")local A=game:GetService("\083\101\114\118\101\114\083\116\111\114\097\103\101")local P=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local c=require(A.Source.DescendantsCollisionGroup)local G=require(P.Source.ComponentCreator)local T=require(A.Source.CollisionGroup)local B=require(P.Source.SharedConstants.CollectionServiceTag.CharacterTag)local Z={}function Z.start()o:RegisterCollisionGroup(T.Character)o:RegisterCollisionGroup(T.Wagon)o:CollisionGroupSetCollidable(T.Character,T.Wagon,false)o:CollisionGroupSetCollidable(T.Wagon,T.Wagon,false);(G.new(B.Character,c,T.Character)):listen()end return Z
--[[
	Creates and configures collision groups.
	Used to prevent characters from colliding with wagons.
--]]

local PhysicsService = game:GetService("PhysicsService")
local ServerStorage = game:GetService("ServerStorage")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local DescendantsCollisionGroup = require(ServerStorage.Source.DescendantsCollisionGroup)
local ComponentCreator = require(ReplicatedStorage.Source.ComponentCreator)
local CollisionGroup = require(ServerStorage.Source.CollisionGroup)
local CharacterTag = require(ReplicatedStorage.Source.SharedConstants.CollectionServiceTag.CharacterTag)

local CollisionGroupManager = {}

function CollisionGroupManager.start()
	PhysicsService:RegisterCollisionGroup(CollisionGroup.Character)
	PhysicsService:RegisterCollisionGroup(CollisionGroup.Wagon)
	PhysicsService:CollisionGroupSetCollidable(CollisionGroup.Character, CollisionGroup.Wagon, false)
	PhysicsService:CollisionGroupSetCollidable(CollisionGroup.Wagon, CollisionGroup.Wagon, false)

	-- DescendantsCollisionGroup.new() will be called with the Character model, CollisionGroup.Character as the arguments
	ComponentCreator.new(CharacterTag.Character, DescendantsCollisionGroup, CollisionGroup.Character):listen()
end

return CollisionGroupManager
