Hello, right now, I am having trouble with making my hats transparent in first person view. When I first saw this issue, I tried doing if child:IsA(“BasePart”) or child:IsA(“MeshPart”) and child.Name ~= “Head” then but that didn’t work. I did “MeshPart” because the hats on my characters are all MeshParts. Since this didn’t work, I renamed most of the hats either glasses, hats, or hair and basically did the same but it said LocalTransparencyModifier couldn’t be found? So my question is, is there a way for me to make the hats transparent or do I have to make them inside of an accessory?
local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character.Humanoid
local camera = workspace.CurrentCamera
-- Camera Settings
player.CameraMaxZoomDistance = 0.5
camera.FieldOfView = 100
humanoid.CameraOffset = Vector3.new(0,0,-1)
-- Changing Transparency
for childIndex, child in pairs(character:GetChildren()) do
if child:IsA("BasePart") and child.Name ~= "Head" then
child:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(function()
child.LocalTransparencyModifier = child.Transparency
end)
child.LocalTransparencyModifier = child.Transparency
end
end