How do I make body parts untransparent in first person?

Hello, I was just wondering how do I make all body untransparent other then the head when players are in first person, (I’d want to keep first person lock on) and the only thing I could think of was using LocalTransparencyModifier. And, yes, I did look over them devForums.

3 Likes

LocalTransparencyModifier is exactly what you need to use. If you take a look in the core camera scripts, you will see that is what they use as well.

1 Like

Do I see core camera scripts by pressing play then checking through scripts, if not, then how?

1 Like

I have code for this. It’s a salvage from when I provided it for another thread, but it can be easily tailored for your use case.

local RunService = game:GetService("RunService")
local LocalPlayer = game:GetService("Players").LocalPlayer

local RENDER_PRIORITY = Enum.RenderPriority.Character.Value - 5

local function updateCharacterTransparency()
    local character = LocalPlayer.Character

    if character then
        for _, part in ipairs(character:GetDescendants()) do
            if part:IsA("BasePart") then
                part.LocalTransparencyModifier = 0
            end
        end
    end
end

RunService:BindToRenderStep("CharacterTransparency", RENDER_PRIORITY, updateCharacterTransparency)

It uses the same method as the PlayerScripts do for enforcing first person transparency. This one makes your entire body visible, so making only specific body parts visible in first person requires editing of the for loop that iterates through the descendants of the character.

8 Likes

I’ll try this out really soon, and it’s funny, I was literally going to ask you about this! :joy: Thanks! You’re the best!

1 Like