LocalTransparencyModifier on Arms broken for me

1. What do you want to achieve? Keep it simple and clear!
I want my tool to have first person arm view (R6), it worked but the next day I open my game for it to stop functioning.

2. What is the issue? Include screenshots / videos if possible!
LocalTransparencyModifier was used to make the arms visible, and it initially worked. Until I woke up a day after to find it doesn’t do so anymore even though it works for other scripts that serve the same purpose, I don’t use the other scripts though because they include a full view model or just weren’t working for my purpose.

3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried using FindFirstChild, WaitForChild, put it in a for loop through all the characters and filtered basepart only to be changed the LocalTransparencyModifier to 0, task.wait() for a delay because it doesn’t instantly change to 1 transparency when in first person mode, I had looked for solutions but they didn’t help or weren’t for my purpose.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
I just want the left and right arms to be visible, that is it, but I cannot get it to work in my own way. It is put in a local script parented under the tool, not handle. I tried everything but I cannot get it to work. I hope maybe you can find a mistake that I can’t find.

– // The LocalScript that makes the arms visible. (IT WORKED BEFORE, NOW IT DOESNT?)

local Char
local tool = script.Parent

local camera = workspace.CurrentCamera
local player = game.Players.LocalPlayer

tool.Equipped:Connect(function()
	Char = script.Parent.Parent
	game.Players:FindFirstChild(Char.Name).CameraMode = Enum.CameraMode.LockFirstPerson
	task.wait(0.5)
	Char:FindFirstChild("Right Arm").LocalTransparencyModifier = 0
	Char:FindFirstChild("Left Arm").LocalTransparencyModifier = 0
end)

tool.Unequipped:Connect(function()
	game.Players:FindFirstChild(Char.Name).CameraMode = Enum.CameraMode.Classic
end)

If you want my full tool with all the scripts, here is the bare-bones rblx place, don’t mind the variables like deployable, etc, it was made for a purpose in the game I’m working on, and I’m not sure if the animations will work for you since it isn’t defined, but you can see that the arms do not appear.
Barebones_StoneTool.rbxl (96.4 KB)

1 Like

I already have a script for this (it works), and I’d like to share it with you. You can put this in StarterGui or StarterPack. Please take note that it also shows the rest of your body, and not just your arms. :

repeat wait() until game:GetService("Players").LocalPlayer.Character ~= nil
local runService = game:GetService("RunService")
local input = game:GetService("UserInputService")
local players = game:GetService("Players")

CanToggleMouse = {allowed = true; activationkey = Enum.KeyCode.F;} -- lets you move your mouse around in firstperson
CanViewBody = true 		-- whether you see your body
Sensitivity = 0.2		-- anything higher would make looking up and down harder; recommend anything between 0~1
Smoothness = 0.05		-- recommend anything between 0~1
FieldOfView = 90		-- fov

local cam = game.Workspace.CurrentCamera
local player = players.LocalPlayer
local character = player.Character or player.CharacterAdded:wait()
local humanoidpart = character.HumanoidRootPart

local head = character:WaitForChild("Head")
local CamPos,TargetCamPos = cam.CoordinateFrame.p,cam.CoordinateFrame.p 
local AngleX,TargetAngleX = 0,0
local AngleY,TargetAngleY = 0,0

local running = true
local freemouse = false

function updatechar()
	
	for _, v in pairs(character:GetChildren())do
		if CanViewBody then
			if v.Name == 'Head' then
				v.LocalTransparencyModifier = 1
				v.CanCollide = false
			end
		else
			if v:IsA'Part' or v:IsA'UnionOperation' or v:IsA'MeshPart' then
				v.LocalTransparencyModifier = 1
				v.CanCollide = false
			end
		end
		if v:IsA'Accessory' then
			v:FindFirstChild('Handle').LocalTransparencyModifier = 1
			v:FindFirstChild('Handle').CanCollide = false
		end
		if v:IsA'Hat' then
			v:FindFirstChild('Handle').LocalTransparencyModifier = 1
			v:FindFirstChild('Handle').CanCollide = false
		end

	end
	
end

input.InputChanged:connect(function(inputObject)
	
	if inputObject.UserInputType == Enum.UserInputType.MouseMovement then
		local delta = Vector2.new(inputObject.Delta.x/Sensitivity,inputObject.Delta.y/Sensitivity) * Smoothness

		local X = TargetAngleX - delta.y 
		TargetAngleX = (X >= 80 and 80) or (X <= -80 and -80) or X 
		TargetAngleY = (TargetAngleY - delta.x) %360 
	end	
	
end)

input.InputBegan:connect(function(inputObject)
	
	if inputObject.UserInputType == Enum.UserInputType.Keyboard then
		if inputObject.KeyCode == CanToggleMouse.activationkey then
			if CanToggleMouse.allowed and freemouse == false then
				freemouse = true
			else
				freemouse = false
			end
		end
	end
	
end)

runService.RenderStepped:connect(function()
	 
	if running then
		updatechar()
		
		CamPos = CamPos + (TargetCamPos - CamPos) *0.28 
		AngleX = AngleX + (TargetAngleX - AngleX) *0.35 
		local dist = TargetAngleY - AngleY 
		dist = math.abs(dist) > 180 and dist - (dist / math.abs(dist)) * 360 or dist 
		AngleY = (AngleY + dist *0.35) %360
		cam.CameraType = Enum.CameraType.Scriptable
		
		cam.CoordinateFrame = CFrame.new(head.Position) 
		* CFrame.Angles(0,math.rad(AngleY),0) 
		* CFrame.Angles(math.rad(AngleX),0,0)
		* CFrame.new(0,0.8,0) -- offset
		
		humanoidpart.CFrame=CFrame.new(humanoidpart.Position)*CFrame.Angles(0,math.rad(AngleY),0)
		character.Humanoid.AutoRotate = false
		else game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.Default; character.Humanoid.AutoRotate = true
	end

	if (cam.Focus.p-cam.CoordinateFrame.p).magnitude < 1 then
		running = false
	else
		running = true
		if freemouse == true then
			game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.Default
		else
			game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.LockCenter
		end
	end
	
	if not CanToggleMouse.allowed then
		freemouse = false
	end
	
	cam.FieldOfView = FieldOfView

end)

Hey! I appreciate you trying to give me one of your scripts but I would also like to understand why it works, and not ctrl c + ctrl v. Also, the script you gave me seems to break with my tools (I can fix but either way I just want to show the arms with no camera changes), I do thank you for trying to help but what I don’t understand is that my approach worked, and now it doesn’t. I would like to understand why.

I haven’t tried runservice events to update the arms and I’m going to try that instead of unequip and equip events, but the fact that it was running perfectly before, and now it isn’t, is shocking. Do you have any idea why?

Solution:
I just put it a render stepped function that constantly updates the arms, this isn’t as efficient as what I did but it works, I still do not understand why my previous solution failed, and I would like to know, but I will mark this as solved.

2 Likes

I had the same problem. Since a few days the right hand LocalTransparencyModifier started to get immediately reset to 1 when tool is equipped. This is apparently an undocumented Roblox core script change.
It is not your fault.
And thank you for the solution - it helped to use BindToRenderStep.

2 Likes