local RunService = game:GetService("RunService");
local Player = game.Players.LocalPlayer;
local Character = Player.Character or Player.CharacterAdded:Wait();
local Camera = game.Workspace.CurrentCamera;
local Head = Character:WaitForChild("Head");
local FPMaximumDistance = 0.6; -- For scalability, but keep it at 0.6 since it is the right distance.
local FirstPersonLocalTransparency = 0;
local ThirdPresonLocalTransparency = 0;
Player.CameraMode = Enum.CameraMode.LockFirstPerson
local function SetCharacterLocalTransparency(transparency)
for i,v in pairs(Character:GetChildren()) do
if (v:IsA("BasePart")) then -- Only baseparts have a LocalTransparencyModifier property.
v.LocalTransparencyModifier = transparency;
end
end
end
RunService.RenderStepped:Connect(function()
local isfirstperson = (Head.CFrame.Position - Camera.CFrame.Position).Magnitude < FPMaximumDistance; -- Determine wether we are in first person
if (isfirstperson) then
SetCharacterLocalTransparency(FirstPersonLocalTransparency);
else
SetCharacterLocalTransparency(ThirdPresonLocalTransparency);
end
end)
I got this code from another question on the DevForum, and I want it to look like how phantom forces does it, and other survival games where you can see the entire body without the torso being in the way. Any help is appreciated.
If possible link to sources so I can fully understand the solution.
Instead of instantly setting the LocalTransparencyModifier, check if it is named “Torso” or in R15 “Upper Torso”. If it is don’t change the LocalTransparencyModifier. This will solve your problem.
local function SetCharacterLocalTransparency(transparency)
for i,v in pairs(Character:GetChildren()) do
if (v:IsA("BasePart")) and v.Name ~= "Torso" and v.Name ~= "UpperTorso" and v.Name ~= "LowerTorso" then -- Only baseparts have a LocalTransparencyModifier property.
v.LocalTransparencyModifier = transparency;
end
end
end
which I don’t want, I want the full body visible I just don’t want the torso to be obstructing the camera, let me re-iterate that I still want the torso visible if I look down, I don’t want to see the neck part like in my original post.
I tried with the currentcamera.CFrame and it kept the camera in one position and when I would walk the head would be in the camera blocking it entirely.
U can make another script, which might be more work. pretty sure its on youtube tho.
U can make the player’s character not be completely visible, a bit transparent, maybe that will look more “clean”.