LocalTransparencyModifier giving errors depsite it working

So i havent really seen any posts talking about this issue, where localtransparencymodifier seems to give an error whenever i use it, even tho its working perfectly fine!

Maybe its because my game is R6, but im not entirely sure. heres the piece of code im using:

RunService.RenderStepped:Connect(function()
	for _, rizz in pairs(character:GetChildren()) do
		if string.match(rizz.Name, "Arm") then
			rizz.LocalTransparencyModifier = 0
		end
	end
end)

and this is the error it gives:

and as you can see it works:

maybe i made a mistake? i dont know, thanks in advance.

Yeah you probably solved this anyway;

You are attempting to modify the “CharacterMesh” class which is found in character models (basically special meshes for character parts).

Their instance name sometimes matches limb names like “Roblox 2.0 Right Arm” as shown in your error message.

Since LocalTransparencyModifier only exists in parts try checking if the part is a BasePart:

RunService.RenderStepped:Connect(function()
	for _, Part in pairs(character:GetChildren()) do
		if string.match(Part.Name, "Arm") and Part:IsA("BasePart") then
			Part.LocalTransparencyModifier = 0
		end
	end
end)
1 Like

yea i solved it, the same way you did. its kind of a silly bug.

1 Like

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