Custom Object Outlines

Hello ! I know that ViewPortFrames can be a powerfull tool in creating really cool concepts, so I wondered if there is a way to create custom outlines for objects in my place?
More specifically, I am trying to make objects have a dotted outline.

It does not have to be done via ViewPortFrames ofc, any creative idea is welcome :))

1 Like

Since there’s no inbuilt way to outline a ViewportFrame render, there’s a trick you can do to outline a render in a ViewportFrame (I’ve used it in a game to dynamically generate outlines on tool icons of a custom hotbar - and it’s also used in Mario Kart Wii to outline racer icons on the minimap). The method is:

  1. Clone the ViewportFrame

  2. Make everything within the model that is being rendered in the newly cloned VPF solid white (remove mesh textures, decals, surface appearances, and set the part colours to white).

  3. Remove the shading detail from the cloned VPF by setting the Ambient and LightColor to white.

  4. The above step will allow you to use ViewportFrame.ImageColor3 to change the solid colour accurately to whatever you want.

  5. Offset the cloned VPF by a few pixels depending on how thick you want the outline to be.
    Your icon should look like this so far. This is offsetted 4 pixels left & up.

  6. Clone that new VPF and offset it again in the opposite direction.

  7. Do the same but for the other corners. In total you should have four duped ViewportFrames, one for each corner. (Top left, top right, bottom left, bottom right)
    The result isn’t perfect (if you make the outline too big by offsetting the duped VPFs too far, the faked effect will fall apart) but it’s pretty damn good!

You can push this outline further by storing the duplicated ViewportFrames in a CanvasGroup and utilising a UIGradient inside. Note: the maximum amount of keypoints you can create in a NumberSequence graph is 20.


The only 3D-space outlines we can easily use in the engine are using Highlights. You have to watch how you use these too, because afaik there is a limit of ~32, so use them sparingly - and if you want to use them on a lot of parts then group them into a model and place the highlight within that model. You cannot control the width or style of the outline though.

3 Likes

Thank you for the explanation :)) I fear that this might turn really buggy, cuz I want pretty much everything to be done with this style :// It is not a big place but still