Extremely Laggy Game

Yes, that is the case. It is needed for my game.

2 Likes

Can you listen to me? I already told you the reasons of why your game has high average ping.

2 Likes
local Players = game:GetService("Players")
local PhysicsService = game:GetService("PhysicsService")

local playerCollisionGroupName = "Players"
PhysicsService:CreateCollisionGroup(playerCollisionGroupName)
PhysicsService:CollisionGroupSetCollidable(playerCollisionGroupName, playerCollisionGroupName, false)

local function setCollisionGroup(object)
	if object:IsA("BasePart") then
		PhysicsService:SetPartCollisionGroup(object, playerCollisionGroupName)
	end
	
	for _, child in ipairs(object:GetChildren()) do
		setCollisionGroup(child)
	end
end

Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		setCollisionGroup(character)
	end)
end)

This should be enough already. I picked this script from my old game and works normally

Your telling me something I already know. I need to know an alternative to make this not laggy.

1 Like

Okay, if my help is useless I might as well not waste my time in here.

1 Like

Okay, I will try it out and keep you updated. If there is no lag after a while I will mark the answer as correct.

1 Like

Although, my developer was lagging even opening studio. Could it be a problem with meshes my dev recently added? They are nothing big, but I guess I will just see how things go.

1 Like

Should always double check, I have had a game with a virus before and it killed the performance and when I used a virus plugin it fixed EVERYTHING! If you would like I have a suggestion, TG Guardian made by TGazza, very useful and it scans everything! 10/10 plugin.

Hey, this didn’t seem to work. The players collide with each other, no error.

1 Like

I’m sorry if I was rude. The problem with the script is, that it changes the collision every time a descendant of the character is created or destroyed. Thats just too many changes and since the script has like 30k+ rates I think the problem is really there

No, you were not rude. Your all good!

1 Like

Are u sure? I just tested this script and I can’t collide with players

The script should be in server script service

Yeah I am sure. Script in server script service. Still having issues.

1 Like

Are you testing it in studio? If you published the change and you are trying to test it in a live server, then make sure you shutdown servers, because the changes are going to be only in new servers

Update: It works with some things, but I think accessories still collide. I will fix this on my own.

1 Like

I think accessories don’t collide on default and the script should pick up any thing that is a descendant of player, so accessories should work too…

Its weird. I’m not sure why you have this problem. I created a new place and used the same script and it works without issues

Why do you reset the collision group for an object when it’s removed from the character? At that point the object won’t exist, so there’s no point changing the collision group on DescendantRemoving

2 Likes

Well I changed it to :GetDescendants() and it is still having slight issues. It worked in studio with my avatar, but maybe it is certain avatars that have this issue. I don’t know.

1 Like