Rendering a GUI behind a part

So, I’ve been trying to make a silhouette of the character render infront of parts if it’s obstructed by the environment. I’ve tried to achieve this using a viewport frame, and it worked good except for the fact that it’s rendered over the player itself.
Zrzut ekranu 2023-04-28 214846
(The effect I achieved)

All the code I wrote is for setting the camera and copying the character into the viewport frame.

frame.CurrentCamera = workspace:WaitForChild("Camera")

local player = game.Players.LocalPlayer
player.Character.Archivable = true

game:GetService("RunService").RenderStepped:Connect(function()
	frame:ClearAllChildren()
	local clone = player.Character:Clone()
	clone.Parent = frame
end)

So my real question here is if there’s a way to render the GUI behind the character. I haven’t seen any questions asked like this before, so help would be appreciated.

1 Like

You could use a Highlight object, but there’s currently no way for the effect to show up only through walls

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.