Help With Improving My Use of Highlights

Hi! I’m needing a way to improve the use of highlights in my game.

I really love the thought of using a highlight to outline a specific chunk of area but I’ve run into some problems with the engine that I would greatly appreciate help with. First problem is that I need the highlighted object to be transparent. I’ve looked around, and setting the material to be Glass seems to be a good option, however which I do so, I’m unable to get rid of the reflections on the part, even when I’ve set Reflectance = 0. Here’s what I’ve attempted to resolve this problem, can anyone tell me what I’m doing wrong?

local outline = Instance.new("Part")
	outline.CanCollide = false
	outline.CanQuery = false
	outline.CanTouch = false
	outline.Anchored = true
	outline.Transparency = 1
	outline.Reflectance = 0
	outline.CastShadow = false
	outline.Material = "Glass"
	outline.Position = Vector3.new(<position>)
	outline.Size = Vector3.new(<size>)
	local highlight = Instance.new("Highlight")
	highlight.FillTransparency = 1
	highlight.Parent = outline
	outline.Parent = game.Workspace

Additionally there’s a second problem I’m less hopeful has a solution. It would be even more useful to me if the player could see the highlight while being inside the part, although I’ve found no option that would make this possible and I cannot currently think of a solution. Any help resolving these two questions would be greatly appreciated. Thank you!

Set reflectance to be a negative value and that should fix it

Hi, this doesn’t appear to work. I’ve set Reflectance to -1 and it still does this. This happens both to parts made in the workplace and those generated by a script. Here’s what it looks like:
image

Edit: here’s this btw if it helps)
image

would setting transparency to like, 0.9999 or something work?

Doesn’t appear to, in fact any transparency above 0 on anything other than glass disables the Highlight for whatever reason.

would forcefield material look better than glass?

Hightlights don’t seem to function with the ForceField material at all, regardless of transparency.

If you’re dealing with MeshParts you can just set Transparency to 1, Material to Glass and add any TextureID to them.

As for showing Highlights while inside a MeshPart, you can just enable DoubleSided. For BaseParts and SpecialMeshes it’s a little less straight forward as you’d need to create a copy of the object with inverted CFrame, which in turn also mirrors the object.

Alright, yeah, I started testing it in studio. It isn’t the glass thats reflecting, but the highlight itself, even if its disabled, just as soon as its connected. Only solutions I can find that removes reflection is setting fill transparency to 0 (which looks absolutely insane anyway, so not really useful), and, I was really hoping to then type more solutions after typing the first, but yeah, there are none. I tried everything, from material variants, to 2022 materials.
yeah, there’s nothing you can do to prevent reflections, I even tried disabling like every lighting thing, putting a highlight under something, or even just setting its Adornee to something, will force its reflection to show up, no matter what, even if the highlight nor part is visible, just a floating reflection.

This almost works perfectly, however there remains one slight problem. For whatever reason, the highlight disappears if CanCollide is set to false. Any way around this one? ((((ignore this i was being stupid and didnt set anchored to true))))

If I set CanCollide = true and go inside, the double-sided property doesn’t appear to work as intended. I’ll go ahead and give making the inverted CFrame a shot, as it seems it will be very promising.

I can’t seem to replicate the DoubleSided = true and CanCollide = true issue :thinking:
Can you send an rbxm with the problematic part?

Btw here’s one I made, try testing it out and check if the problem persists:
Non_Specular_Highlight1.rbxm (28.4 KB)

Edit: Added wrong file

Actually, CanCollide doesn’t seem to affect it, but I still can’t get DoubleSided to work.

Here’s an rbxm as an example.
highlighttest1.rbxl (58.5 KB)

Edit: forgot to chance meshtype to FileMesh in that but pretty sure its fine

Seems like neither of the meshes had a texture ID set.

image

For this effect to work, the following criteria have to be met:

  • Part is a MeshPart (no need for SpecialMesh child)
  • Part transparency >= 1
  • Part TextureID is anything

Actually looking at the file you sent, the MeshPart doesn’t need a TextureID if the MeshID is also empty. But just typing “1” into the TextureID field should work for any MeshPart.

The Highlight seems to work well in the file you sent if you remove the second MeshPart that has a SpecialMesh child. It’s just that the Highlight only has an outline which is why you can’t see it when inside the mesh.

Hi, I can’t help but feel now that I might have wasted your time, as I’ve only now thought of a solution that works in the exact way I want it. Essentially, made a cube out of maximally thin cubes. However, without your suggestion of using MeshParts, I wouldn’t have arrived to this conclusion. Thank you for your assistance, you’ve all been great help!

1 Like

Even if my initial suggestion wasn’t quite what you we’re looking for, I’m glad you we’re able to reach a solution that best suits your needs.

Looking at the end result however reminds me of another way to visualise selection: SelectionBoxes. Maybe those could be an alternative for highlighting a specific chunk of area?
Here’s an example of a SelectionBox: SelectionBox_Example1.rbxm (3.2 KB)

Note: They use a fixed thickness for the outlines as opposed to Highlight's pixel based outlines.

image

1 Like

This works so much better and is infinitely more efficient than what I was thinking of doing, thank you!!!

1 Like