First Person Body Showing Script

My First person body showing script simply just won’t show my body.

Here is the local script:

-- initialize local variables
local camera = workspace.CurrentCamera
local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character.Humanoid

-- camera settings
player.CameraMode = Enum.CameraMode.LockFirstPerson -- force first person
camera.FieldOfView = 100
humanoid.CameraOffset = Vector3.new(0, 0, -1)

-- set and keep every body part Transparency to its real 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

-- if the player steps in a vehicle
camera:GetPropertyChangedSignal("CameraSubject"):Connect(function()
	if camera.CameraSubject:IsA("VehicleSeat") then
		camera.CameraSubject = humanoid
	end
end) 

If it helps it may be because I’m using a custom startercharacter.

2 Likes

The children of character could have not been all loaded, use ChildAdded to listen to a new child.

1 Like

It still won’t work. text limitjdaifojadjifoajfeoaifdsad

1 Like

Could I see the updated code you just did?

1 Like

The LocalTransparencyModifier is really buggy so have you have to probably create fake arms.
Example: (bad code warning)

1 Like

LocalTransparencyModifier isn’t buggy

1 Like

I tried the LocalTransparencyModifier method once and it literally didn’t work.
Even then using it would be jank because it can just break without warning (SCREW THE CURRENT HUMANOID CONTROLLER).

I’ve also tried it, it works all the time for me. It could be a problem with how you coded it.

Can’t test it out because roblox borked studio for me so maybe it works now?

-- initialize local variables
local camera = workspace.CurrentCamera
local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character.Humanoid

-- camera settings
player.CameraMode = Enum.CameraMode.LockFirstPerson -- force first person
camera.FieldOfView = 100
humanoid.CameraOffset = Vector3.new(0, 0, -1)

-- set and keep every body part Transparency to its real transparency
for childIndex, child in pairs(character:GetChildren()) do
	if childAdded:IsA("BasePart") and childAdded.Name ~= "Head" then

		child:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(function()
			child.LocalTransparencyModifier = child.Transparency
		end)

		child.LocalTransparencyModifier = child.Transparency

	end
end

-- if the player steps in a vehicle
camera:GetPropertyChangedSignal("CameraSubject"):Connect(function()
	if camera.CameraSubject:IsA("VehicleSeat") then
		camera.CameraSubject = humanoid
	end
end) 

Where is the character.ChildAdded connection?

Oh I forgot, sorry. I actually am just gonna switch it to third person anyways as it would be better for my game.

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