Hello Roblox Developer Community,
How can i make the player able to see his own character/body ? (locked first person.)
I wonder how i can make it happen.
If you have any suggestions or responses, feel free to tell me. Thank you, have a great day !
HI there! To achieve this, you can create a LocalScript and write the following:
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local camera = workspace.CurrentCamera
-- load character
repeat task.wait() until player.Character
local Character = player.Character
local Humanoid = Character:WaitForChild("Humanoid")
local distance_Camera = (camera.CFrame.Position - camera.Focus.Position).Magnitude
-- Work
camera:GetPropertyChangedSignal("CFrame"):Connect(function()
distance_Camera = (camera.CFrame.Position - camera.Focus.Position).Magnitude
end)
for i,v in pairs(player.Character:GetDescendants()) do
if(v.Name ~= "HumanoidRootPart" and v.Name ~= "Head")then
local S,F = pcall(function()
if(v:IsA("Part") or v:IsA("MeshPart") and not v:IsA("Accessory"))then
v.Transparency = 0
v.LocalTransparencyModifier = 0
v:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(function()
v.LocalTransparencyModifier = 0
end)
end
if(v:IsA("Accessory"))then
v.Handle.Transparency = 1
v.Handle.LocalTransparencyModifier = 1
v.Handle:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(function()
v.Handle.LocalTransparencyModifier = 1
end)
end
end)
end
end
In a local script, parented in starterchar scripts copy/write down the following:
localCharacter = game:GetService(“Players”).LocalPlayer.Character
game:GetService(“RunService”).RenderStepped:Connect(function()
for key, value in pairs(localCharacter:GetChildren()) do
if string.match(value.Name, “Arm”) then
value.LocalTransparencyModifier = 0
end
end
end)
localCharacter = game:GetService(“Players”).LocalPlayer.Character
game:GetService(“RunService”).RenderStepped:Connect(function()
for key, value in pairs(localCharacter:GetChildren()) do
if string.match(value.Name, “Leg”) then
value.LocalTransparencyModifier = 0
end
end
end)
localCharacter = game:GetService(“Players”).LocalPlayer.Character
game:GetService(“RunService”).RenderStepped:Connect(function()
for key, value in pairs(localCharacter:GetChildren()) do
if string.match(value.Name, “Torso”) then
value.LocalTransparencyModifier = 0
end
end
end)