Seated character being transparent when CameraMode is Scriptable/Custom

Currently I have been working on a script which locks first person when the space key is being pressed. It will lock first person and set CameraType into Custom, or otherwise, the CameraType will be Scriptable and it’s CFrame will be a part in Workspace. In this entire process, the character must be sitting. c.IsSeated is a custom value stored in character to check whether the humanoid is sitting or not by using another script.

local plrs = game:GetService("Players")
local UIP = game:GetService("UserInputService")
local p = plrs.LocalPlayer
local c = p.CharacterAdded:Wait()
local cam = workspace.CurrentCamera

UIP.InputBegan:Connect(function(input, gameProcessed)
	if c.IsSeated.Value == true then
		if input.KeyCode == Enum.KeyCode.Space then 
			if p.CameraMode == Enum.CameraMode.Classic then
				p.CameraMode = Enum.CameraMode.LockFirstPerson
                cam.CameraType = Enum.CameraType.Custom
			else
				if p.CameraMode == Enum.CameraMode.LockFirstPerson then
					p.CameraMode = Enum.CameraMode.Classic
					cam.CameraType = Enum.CameraType.Scriptable
					cam.CFrame = c.Humanoid.SeatPart.Parent.Cam.CFrame
				end
			end
		end
	end
end)

I also modified LocalTransparencyModifier on Character’s arms and hands, such that they will be visible in First person. If I do not modified them, the entire character will be transparent when I toggle first person/third person.

runser.RenderStepped:Connect(function()
c:WaitForChild("LeftLowerArm").LocalTransparencyModifier = 0
c:WaitForChild("LeftUpperArm").LocalTransparencyModifier = 0
c:WaitForChild("LeftHand").LocalTransparencyModifier = 0
c:WaitForChild("RightLowerArm").LocalTransparencyModifier = 0
c:WaitForChild("RightUpperArm").LocalTransparencyModifier = 0
c:WaitForChild("RightHand").LocalTransparencyModifier = 0

end)

However, the result:

I don’t know is this a Roblox bug or not, if I set all character’s MeshParts/Parts/Accessories’LocalTransparencyModifier to 0, this will probably get fixed. However I only want arms and hands’ LocalTransparencyModifier to 0 but not others.

Any solutions to this problem? Thanks! :grinning:

I am completely confused as to what you’re trying to accomplish, because the question is obscure as well as your intent. Please clarify what exactly you’re looking for. To me, it seems like you’ve already accomplished what you’re looking to have done. I can’t quite grasp what you want from your thread.

Definitely not one, regardless of what the content of the thread is asking for.

Aren’t you already doing this…?

1 Like

If it’s already working, why did you post a thread about how to get it to work?

Sorry for making it really confusing to you guys. I try to break it down and explain it clearly:

**What is happening: **
When a player is seated, and space is being pressed, CameraMode will be LockFirstPerson and CameraType will be Custom.

When space is being pressed again, CameraMode will return to Classic and CameraType will be Scriptable.

What I want to solve:
When it returns back to third person, the character went transparent. Is there any solutions on that to make it not being transparent?

runservice.RenderStepped:connect(function()

–if CameraMode == Enum.CameraType.Classic then --set transparency to 0 else --set transparency to 1

end