I've been bitten by a radioactive bug and now I can see objects through walls

And because this was such a life-changing experience for me I’ve decided to share it with you all by recreating the effects in roblox.

[video]http://www.youtube.com/watch?v=DsN9-dCTM7A&feature=youtu.be[/video]

Graphical Issues:

  • Zooming in way close (less than 1 stud) to other parts makes the part outlines vanish behind the block you’re zooming in to, exactly how moving blocks go through a non-colliding part looks.

Other things to watch out for:

  • This code puts the outline parts into the current camera and uses the same camera forever.
  • Removing a part will remove its outline

Script attached. It assumes that it’s in a local script. Last few lines are use demonstrations. Protip: Drop the functions into _G and call them from elsewhere. Functions are:

  • AddOutlineToPart(BasePart part, Color3 color)
  • RemoveOutlineFromPart(BasePart part)
  • AddOutlineToModel(Object model, Color3 color) – doesn’t have to be a model
  • RemoveOutlineFromModel(Object model)
  • SetModelOutlineTransparencyScale(Object model, Number scale) – 0-1
  • SetPartOutlineTransparencyScale(BasePart part, Number scale) – 0-1

If you don’t provide a color argument it will use the part’s color.

This was made in for a game that I’m thinking of making. Hopefully won’t end up as another dead project. Feel free to use it however you want. No credit necessary, but it is appreciated. Improvements on the code are also always appreciated. Have fun!

EDIT: IDK how to do attachments. Here’s the code.

EDIT #2: I didn’t really describe what this does. It allows a specific person to see an object through walls by creating local parts that overlay the object on the screen and are always 1 stud away from the camera. Hopefully that explains it well enough for people to begin asking me to explain more specific parts.

EDIT #3: Z-Fighting and layering bugs fixed. It now works with 0 transparency so it can be used practically (yay!). Updated video and code.

EDIT #4: Added edit #4.

EDIT #5: Added support for decals. Transparency can now be set dynamically with two new functions. Expanded on the use demonstration. Updated video and code to reflect these changes.

Innovative!
I remember back in the day I would use “Handles” to represent players through walls :stuck_out_tongue:

[quote] Innovative!
I remember back in the day I would use “Handles” to represent players through walls :stuck_out_tongue: [/quote]

I was actually thinking of turning this into a plugin for that admin script I have somewhere and admins could say “showplayers” and all of the players would have a feam-colored outline. But then I ran out of computer time :frowning:

Cool! I also remember doing some similar lens flare effects using local parts and the camera.
Although using GUIs would be much more efficient for some things like this
Now I want a BillboardGui without the Adornee Part overhead :pinch:

Absolutely amazing, great job!

I know that feel, my parents are constantly restricting my computer time.

UPDATE: Layering issue and Z-Fighting issue are fixed. It now works with 0 transparency! Will be updating the code and video shortly.

I fixed the issues by placing the outlines at different distances from the camera based on their distance from the camera, relative to each other. This way their distance in physical space is accurately represented.

EDIT:
UPDATE #2: Added decal support and forced the transparency to be not 0. This keeps the ugly shadows away. Also added two new functions that allow transparency to be scaled. Also updated video and code again.

Please give this to loleris to implement in Darkness! He has that nice billboardGUI but this would look incredible instead.

That was the first use of this I thought of.

That’s actually the first thing that came to mind when I was deciding how useful it would be if it was released. I’d love to see it implemented in that way.