Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I make the script show the character entirely?

I have this camera script, that shows the player in a special third-person perspective. The script IS working, but for some reason, I can't make the Accessory part meshes visible. I tried it multiple times with different approaches, but nothing works. Can you help me with my issue? The script:

c = workspace.CurrentCamera

player = game.Players.LocalPlayer
char = player.Character or player.CharacterAdded:wait()
humanoid = char:WaitForChild("Humanoid")


player.CameraMaxZoomDistance = 0.5
c.FieldOfView = 90 
humanoid.CameraOffset = Vector3.new(1,0.2,1)

function lock(part)
	if part and part:IsA("BasePart") then
		part.LocalTransparencyModifier = part.Transparency
		part.Changed:connect(function (property)
			part.LocalTransparencyModifier = part.Transparency
		end)
	end
end

for _,v in pairs(char:GetChildren()) do
	lock(v)
end

char.ChildAdded:connect(lock)


c.Changed:connect(function (property)
	if property == "CameraSubject" then
		if c.CameraSubject and c.CameraSubject:IsA("VehicleSeat") and humanoid then
			c.CameraSubject = humanoid;
		end
	end
end)

(P.S. This script is not mine! Thanks in advance!)

1 comment

0

change line 10 to your custom offset

1 answer

✓ Accepted answer

on line 21, you are using :GetChildren(), which will only check the top layer of objects in the character. Replace that with :GetDescendants() and it will check all the objects as well as their children.

for _,v in pairs(char:GetDescendants()) do
	lock(v)
end

1 comment

1

Thank you very much!

This discussion is preserved as it was. New answers, comments, and votes are closed.