I am trying to place the players camera infront of the player’s body. This script below could help with that:
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;
local FirstPersonLocalTransparency = 0;
local ThirdPresonLocalTransparency = 0;
local function SetCharacterLocalTransparency(transparency)
for i,v in pairs(Character:GetChildren()) do
if (v:IsA("BasePart")) then
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)