I made something to test highlighting player’s behind walls using ViewportFrame Masking, but found that the color of the glass required for the effect to work always used the background color of the ViewportFrame at low transparency. At high transparency the part color is used, but the player’s highlight is barely visible. At ~0.5 transparency the highlight still gets obscured by the part color, albeit not by much.
I found this post that was last replied to a year ago but it doesn’t seem like it was ever resolved:
0.1 Transparency Glass:
0.9 Transparency Glass (part color visible but highlight barely visible):
Putting another part over the glass in viewportframe blocks the highlight altogether:
I can’t use a different material since the glass is required for the ViewportFrame Masking to work. Is there anything I could do to work around the glass showing ViewportFrame background color instead of its own? I’ll attempt to work with the 0.5 transparency for the moment but I’d like to know if there’s a solution.
The highlight highlights the whole part, even if some of the part isn’t fully behind a wall. I wanted to try to make a more accurate one. Its not very practical though and a highlight would definitely be better for actual use.
Sadly there’s really no way to bypass that annoying side effect of using glass to reveal the mask meshes.
There’s another way to achieve similar highlights by using actual Highlights. Not sure if its been documented before but here’s a quick explanation of how to do it:
First create an AlwaysOnTopHighlight for the [Blue] object you want to be highlighted over walls.
Then create a clone of the [Blue] object with glass material and 1 transparency. Scale the cloned [Red] object towards the camera so that it appears the same size from the camera’s perspective while always remaining in front of the other highlighted [Blue] object.
Lastly give the [Red] object an OccludedHighlight with 1 FillTransparency and 0.9999999 OutlineTransparency so that it’ll mask out the Highlight of the [Blue] object while remaining nearly invisible:
Now when the player is behind a wall, the OccludedHighlight gets blocked by the wall, while the AlwaysOnTopHighlight appears over it:
Note: you can get rid of the specular highlights on the glass meshes by giving them a TextureID. Also the glass meshes can’t be fully invisible (has to be at 0.9999999 transparency) when they have a WrapTarget and the parent character has a Humanoid.
Thanks for showing that! I never knew you could still get that effect with regular highlights since, when I’d searched for it previously, I hadn’t found many posts about it.