How would I achieve the opposite of the "When Occluded" option of a HighlightEffect?

I’m trying to make an isometric game, and I decided it would help to have the player avatar be highlighted when it is behind an object. However, Roblox can only achieve the opposite by default. How might I go about doing this? I’m not the strongest scripter.

I thought it had an “always on top” option

It does, but i’m aiming for the true opposite of WhenOccluded: The hightlight only kicks in when it’s occluded, and unoccluded parts of the character are not highlighted.

maybe this topic will help?
i found this reply which proposes a “hacky” solution to what i believe you’re looking for.

1 Like

I actually did find this solution, but it created horrible lag and seemed to conflict with my camera’s scripted behavior. Additionally the player’s avatar would occasionally just fly around, probably colliding with the clone.
I then also tried having a total highlight lerp/fade in when the player’s avatar was occluded, but I suck at raycasting, couldn’t get it to work.