I would like to achieve this effect:
I was looking trough entire DevForum but i couldn’t find anyone who wanted to achieve this same effect as i do.
I would like to achieve this effect:
In StarterPlayer, set DevCameraOcclusion to Invisicam
That works but i want it to work only on certain parts.
i am not really a scripter so i dont know how to do it properly.
It may not be the best way to do it, but
repeat wait() until game.Players.LocalPlayer.Character:FindFirstChild("HumanoidRootPart") --wait for the humanoidrootpart
local hrp = game.Players.LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
local blacklist = workspace.CameraBlacklist:GetChildren()
local transparent = {}
local camera = workspace.CurrentCamera
game:GetService("RunService").Heartbeat:Connect(function() --fires every frame, you could change it to a while loop
local p = camera:GetPartsObscuringTarget({hrp.Position},blacklist) --get parts in the way between the camera and the humanoidrootpart
for _, parts in pairs(p) do --iterate through the parts
if not game.Players:GetPlayerFromCharacter(parts.Parent) and parts.Parent.ClassName ~= "Accessory" then --check if a part is a part of a player
if not table.find(transparent,parts) then --check if the part is already transparent, and if not
table.insert(transparent,parts) --inserts it into the table
parts.LocalTransparencyModifier = .8 --and changes its transparency locally so you can get the previous transparency with part.Transparency
end
end
end
for _,tra in pairs(transparent) do --get all transparent parts
if not table.find(p,tra) then --check if a transparent part is inbetween the camera and the character
table.remove(transparent,table.find(transparent,tra)) --if its not, remove it from the transparent parts table
tra.LocalTransparencyModifier = tra.Transparency --and make it visible again
end
end
end)
you’ll have to put the parts you don’t want to be invisible in a folder called CameraBlacklist