FPS drops because of updateInvalidatedFastClusters

I’m currently experiencing large FPS drops in my game due to “updateInvalidatedFastClusters”. This occurs only in first person, which I’m pretty sure is because this is when my game’s viewmodel is enabled which uses the player’s characters arms.

In 3rd person, the game runs perfectly fine:

In 1st person, with the viewmodel enabled, my FPS drops:

The only topic I’ve found about this is a bug report (updateInvalidatedFastClusters/updateEntity triggers on character descendant part property changes, causing spikes) that is marked as fixed, but the problem doesn’t seem to be fixed for me.

This is the setup for my viewmodel:

What I do is the viewmodel’s Motor6Ds connects to the character’s corresponding limbs while in first person, and the viewmodel’s shoulder transforms match the actual shoulder transforms:

image

image

Is there a known fix for this? My current options are:

  1. Make a bug report and wait for a fix, which I dont want to have to do
  2. Find a workaround
  3. Change how I’m handling my viewmodel (maybe don’t use the player’s actual character arms but instead a copy)

Extra:
I tried having the viewmodel enabled even while in 3rd person, and look:

My FPS is perfectly fine. So it has something specifically to do with being in first person? The only thing I can think of is I’m forcing the character’s arms to stay opaque:

image

So I commented out these lines and:

It’s fixed. So this means the FPS drop is because of setting the character’s arm transparency. Which this is weird because from my knowledge this is a common tactic, so this FPS drop must be common for other people too?

I’m going to look at workarounds for this and reply when I find a fix for anyone who finds this in the future

Alright, I found a fix. For anyone who doesn’t want to read the entire post, the problem was forcing the character’s arms to be opaque every frame, like so:

image

The fix I found is to simply not allow Roblox to make your character transparent in the first place. You can do this by setting the camera subject to the player’s head:

Which doesn’t allow the core scripts to force the character transparent, and now you just need to manually set the limbs you want to be transparent while in first person:

And the problem is fixed! I’m very happy with this since it’s not a crazy workaround. The only caveat I’ve found is that the character now doesn’t turn with the camera in first person, but this isn’t too difficult of a fix (and could actually be desirable if you’d prefer to do it yourself anyways)

Here’s my code for manually toggling the character’s transparency:


--!strict

local ALLOWED_LIMB_NAMES = {"Head", "Torso", "Left Leg", "Right Leg"}

local function toggleCharacterFirstPersonTransparency(Model: Model, Toggle: boolean)
	for _, Child in Model:GetChildren() do
		if Child:IsA("Accessory") then
			for _, Sub in Child:GetChildren() do
				if Sub:IsA("BasePart") then
					Sub.LocalTransparencyModifier = Toggle and 1 or 0
				end
			end
		elseif Child:IsA("BasePart") and table.find(ALLOWED_LIMB_NAMES, Child.Name) then
			Child.LocalTransparencyModifier = Toggle and 1 or 0
		end
	end
end

return toggleCharacterFirstPersonTransparency

Toggle true for transparent, and false for opaque

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.