CustomPhysicalProperties lagging

I was experiencing some lags in my new game
Do you know if changing CustomPhysicalProperties every frame can cause lags? But it’s usually changing to the same value, so smth like this:

RS.Heartbeat:Connect(function()
	for i,plr in pairs(game.Players:GetChildren()) do
		if os.time()%100 == 0 then
			plr.Character.HumanoidRootPart.CustomPhysicalProperties = PhysicalProperties.new(20, 0.5, 1, 0.3, 1)
		else
			plr.Character.HumanoidRootPart.CustomPhysicalProperties = PhysicalProperties.new(0.3, 0.5, 1, 0.3, 1)
		end
	end
end) 

You are changing it every 100 sec, Changing CustomPhysicalProperties shouldnt lag, it might lag because the value is a Datatype so a change gets detected because it probably wont check if it’s the same, the best thing I would do is to check if a change is even needed before actually changing it

1 Like