Help finding screen coordinates of the edges of a model on screen

  1. What do you want to achieve? Keep it simple and clear!
    I need to find points along the edge of any part/mesh on screen on every frame.

For clarification:
image

The white is the edge that I want to find the screen coordinates of:
image

  1. What is the issue? Include screenshots / videos if possible!
    I am thinking of using ViewportPointToRay to find the screen coordinates of a model and calculate which points are the edge from there, but since I would have to do this on every frame for the entire screen I am worried that it would be laggy.

    I also thought about trying to calculate where the edges might be on screen using the part size and CFrame but I am unsure of how to approach this, and it wouldn’t work for meshes.

Please tell me if there are any ways to reduce the lag from using the first method, or any tips on how to approach the second, or if there is a third method I could explore. Thank you very much.

May I ask what do you need it for?

1 Like

I plan on using the screen coordinates to make an outline around the character using any image.
Initially wanted to use particle emitters but AFAIK it would not show the particles properly as parts obscured by other parts would still spawn particles that may interfere with particles spawned by parts above it.
I thought using images through a ScreenGui would allow the outline to work properly regardless of the character’s pose.

Have you tried using the Highlight object for this? Parent it to the character model and set the fill transparency to 1 and the outline to 0.

1 Like

The highlight is a solid outline which isn’t exactly what I’m aiming for. I wanted to use custom images as an outline.

Thank you though!

Ah, I see. Do you want the image act as a texture for the outline or do you want it to be small images surrounding the model? If it’s latter, I’m not sure there’s any other way than what you’ve described, although as you’ve said too, it could affect the performance. I did found this though

You could try experimenting with this method UGC artists use to create the outline effect for meshes. However I’m not how you could make it work for different characters from different players.

1 Like

Thank you very much for the video! It’s an interesting effect I’ll look into.

For the purposes of this post though I’m looking for the latter. It’s a shame if the way I’ve described is the only way, but thank you for your responses.

1 Like

I managed to get it working with a very small amount of lag, although it seems very janky. I’ve also come to realise that using images would not work very well due to the nature of the outline so I will explore a different way to accomplish what I need.

1 Like