Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How can I make the script show the character entirely?

Asked by 4 years ago

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!)

0
change line 10 to your custom offset Leamir 3138 — 4y

1 answer

Log in to vote
0
Answered by
Mayk728 855 Moderation Voter
4 years ago

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
Thank you very much! User#34929 0 — 4y
Ad

Answer this question