Object "X-Ray/Highlighting" System

We’ve included a release page with a precompiled RBXM file and Roblox Marketplace Asset link for those who had issues compiling this code themselves with rojo or would rather code inside of Roblox Studio.

3 Likes

uhh is this still up to date? I haven’t been able to get it working-

It doesn’t work, it’s been two years.

1 Like

This should still work :slightly_smiling_face: I would recommend downloading the rbxm from the releases page and trying it out with the example code in the first post

3 Likes

Sorry for disturbing you, but is it possible to have an x-ray outline, kind of like in hitman 3?
A bit like this

2 Likes
5 Likes

Oh, perfect! Thanks for helping me out.

Thank you for your contribution to the community! I will use in my projects.

Would this work on people? For example say Im making a team-based game and want it so you can see your teammates through walls. Would I be able to do this?

Hi, sorry. I can’t figure out :removeFromStack(), for some reason this function doesn’t work at me. You can help me?

My script:


local myCustomRenderImpl = (function()


	return function()

		return {
			onRender = function(_, worldPart, viewportPart, highlight)
				viewportPart.CFrame = worldPart.CFrame
				viewportPart.Color = highlight.color
			end,
		}
	end
end)()


local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")

local ObjectHighlighter = require(ReplicatedStorage:WaitForChild("Modules"):WaitForChild("ObjectHighlighter"))

local myScreenGui = script.Parent
local myRenderer = ObjectHighlighter.createRenderer(myScreenGui):withRenderImpl(myCustomRenderImpl)



ReplicatedStorage.Remote.Events.Highlighter.OnClientEvent:Connect(function(Object,Action)
	local myHighlight = ObjectHighlighter.createFromTarget(Object)
	myHighlight.color = Color3.fromRGB(255, 234, 0)

	local function Add()
		myRenderer:addToStack(myHighlight)
	end
	
	local function Remove()
		myRenderer:removeFromStack(myHighlight)
	end
	
	if Action == "Add" then
		Add()
	elseif Action == "Remove" then
		Remove()
	end
end)

RunService.RenderStepped:Connect(function(dt)
	myRenderer:step(dt)
end)

This is no longer required, as Roblox released the Highlight object for this purpose some time ago.

Highlight is still disabled, there’s no promise if it’ll be out soon.

2 Likes

I know, but chances are it’ll be out soon.

Hello! Firstly, i’d like to say this is an amazing module! However, i can’t find of how to get rid of all active highlights, could you please inform me how (if there is a way)

where’s the link to the module?

For some reason, they’ve been teasing it for months. It doesn’t seem like they want to release it, even though the feature is fully functional when you activate the FFlag.

I tried getting the module to highlight all of the models in the workspace except for the players. the script skips the for loop.

Wait, how can i make it so that it highlights everything in the workspace except player?

How would you change the highlight colour for the model?

1 Like

then how does boatbombers demo work still?

1 Like