Alright, so I have a game where I want the player to be in first person and also see their body when they look down. When I do this, however, the torso takes up a large part of their field of view. To combat this, I set the camera offset a bit forward so they could only see the front of their body, and this is where the problem arose. Because of the camera being slightly closer to the wall, when the player pushes up against the wall the camera glitches inside of it and they can see past it to the other room. Is there anything at all that I can do to fix this issue?
Code:
local player = game.Players.LocalPlayer
local char = player.Character
char.Humanoid.CameraOffset = Vector3.new(0, 0, -0.9)
for i, v in pairs(char:GetChildren()) do
if v:IsA("BasePart") and v.Name ~= "Head" then
v:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(function()
v.LocalTransparencyModifier = v.Transparency
end)
v.LocalTransparencyModifier = v.Transparency
end
end