physicsService not working in-game but works in-studio

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? i want to make players not collide with certain parts

  2. What is the issue? it only works in-studio, in-game, no

  3. What solutions have you tried so far? tried looking for solutions on the devforum, no results, tried to manually make the collisions, still not, tried to manually set the “certain parts” collisions, and nope.

my current script:

local physicsService = game:GetService('PhysicsService')
game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		for i, v in pairs(char:GetDescendants()) do
			if v:IsA("BasePart") then
				physicsService:SetPartCollisionGroup(v,'Players')
				print('added')
			end
		end
	end)

collision groups:
image

is there something im doing wrong? or is there something wrong with the service?

When the character first spawns not all of their parts are parented in their character yet. Try using CharacterAppearanceLoaded to see if your problem gets fixed.

1 Like