First Person Body script for Custom rig Not working

I tried to make a First Person Body Script for my custom rig but it isn’t working and it isn’t showing the body parts, no output errors.

local character = player.Character or player.CharacterAdded:Wait()

local function firstPersonSetup()
	character = player.Character or player.CharacterAdded:Wait()

	local humanoid = character:FindFirstChildOfClass("Humanoid")
	if not humanoid then
		warn("No Humanoid found!")
		return
	end

	local partsToShow = {
		"ArmR", "ArmR2", "RightHand",
		"ArmL", "ArmL2", "LeftHand",
		"LegR", "LegR2", "FootR",
		"LegL", "LegL2", "FootL",
		"Body", "Backpack"
	}

	for _, partName in ipairs(partsToShow) do
		local part = character:FindFirstChild(partName)
		if part then
			part.LocalTransparencyModifier = 0
		else
			warn("Missing part:", partName)
		end
	end

	humanoid.CameraOffset = Vector3.new(0, -1.5, 0)
end

firstPersonSetup()

player.CharacterAdded:Connect(firstPersonSetup)

Can someone help?

If you are using Roblox R15 default avatars, “ArmR”, “ArmL”, … don’t exist. Use the real names instead :

  • Head
  • UpperTorso / LowerTorso
  • LeftUpperArm / LeftLowerArm / LeftHand
  • RightUpperArm / RightLowerArm / RightHand
  • LeftUpperLeg / LeftLowerLeg / LeftFoot
  • RightUpperLeg / RightLowerLeg / RightFoot

To set correctly the LocalTransparencyModifier property on a character’s part, you need to use the RunService to set the property before RobloxCoreScripts do :

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

RunService:BindToRenderStep("local-transparency-modifier", Enum.RenderPriority.Character.Value, function() -- Calls the function every render step. RenderPriority allows you to set the property before RobloxCoreScripts. The string "local-transparency-modifier" can be changed to whatever you want
	for _, v in pairs(Player.Character:GetChildren()) do
		if v:IsA("BasePart") and v.Name ~= "HumanoidRootPart" then -- Show only BaseParts you want
			v.LocalTransparencyModifier = 0 -- Sets the LocalTransparencyModifier
		end
	end
end)

Well that isn’t it, It’s for a custom rig and not a casual avatar

Ok. So the problem is that you only set LocalTransparencyModifier one time, so make sure to update it every render.

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