I have been creating an eerie game and have run into a problem. A pretty major one. My local player’s camera isn’t showing the player’s body when it’s set to a camera! In simpler words, I have a camera that simply just watches the hallway that the player is in. The hallway has toxins that make the player unconcious and then it cuts to a view of that camera in the hallway, and I want the player to be shown in it.
The problem? My game is first person, and in first person the body is not shown. I have experimented with various body transparency altering techniques but it interferes with my viewmodel arms script, for the first person view.
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local camera = workspace.CurrentCamera
wait(5)
if character then
camera.CameraType = Enum.CameraType.Scriptable
for _, part in pairs(character:GetChildren()) do
if part:IsA(“BasePart”) then
part.LocalTransparencyModifier = 0 – this makes player visible on any view
end
end
end
This works for the body parts; but what about the accessories?
I also changed the code up a bit, to account for the head and what i THOUGHT would be accessories:
for _, part in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
if part:IsA("MeshPart") or part:IsA("SpecialMesh") or part:IsA("BasePart") or part.Name == "Head" or part:IsA("Accessory") then
print(part.Name)
part.LocalTransparencyModifier = 0
end
end
it worked; it found the accessory and tried to change it’s transparency modifier but, it errored and say there isn’t one. What is the thing to change for the accessories then?
wait(1)
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local camera = workspace.CurrentCamera
if character then
camera.CameraType = Enum.CameraType.Scriptable
for _, part in pairs(character:GetChildren()) do
if part:IsA("BasePart") then
part.LocalTransparencyModifier = 0
elseif part:IsA("Accessory") then
part.Handle.LocalTransparencyModifier = 0
end
end
end