So I’m trying to make it so you can see the players body parts when in first person.
The script works just fine in an empty project, but in my main game, it does not work.
Script:
local camera = workspace.CurrentCamera
local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character.Humanoid
player.CameraMaxZoomDistance = 0.5 -- force first person
camera.FieldOfView = 100
humanoid.CameraOffset = Vector3.new(0, 0, -1)
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
I have tried disabling all my scripts but it still doesn’t work.
Instead, it works for a second then disappears.
Why is it doing this? Or can someone explain what stops this script from working?
Video of the problem:
Edit: So I figured out that it wasn’t working because the avatar type was R15, and it only works with R6, but is there a way to get it to work with R15/Why isn’t it working with R15?
i had this error one time too, you must open a new baseplate then copy everything in your game to that baseplate and save it (overwrite) it to your main game
--//Services
local Players = game:GetService("Players")
--//Variables
local LocalPlayer = Players.LocalPlayer
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local CurrentCamera = workspace.CurrentCamera
--//Initialization
LocalPlayer.CameraMaxZoomDistance = 0.5
CurrentCamera.FieldOfView = 100
Humanoid.CameraOffset = -Vector3.zAxis
for childIndex, child in ipairs(Character:GetChildren()) do
if not child:IsA("BasePart") or child.Name == "Head" then
continue
end
child.LocalTransparencyModifier = child.Transparency
child:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(function()
child.LocalTransparencyModifier = child.Transparency
end)
end
Your script does work on an empty baseplate. That leads me to believe that some other script or configuration is conflicting with it. You said you disabled all your scripts, but are you certain? Seems like some script starts running after your first person camera script that is overwriting your camera changes.
I’ve figured out the issue. The player type was R15. Apparently it does not work with R15 for some reason, it only works with R6, but is there a way to get it to work with R15?
Thank you but that did not work either. The original author of that post said that other scripts were interfering with it, causing it to not work, but I am in an empty baseplate with no other scripts yet it still does not work. Thanks anyway. I am not sure why it does not work, but I give up so I’m just going to mark this as the solution.