2d Screen Position of Object In Viewport Frame

How do I get the 2d screen position of an object in a viewport frame using that viewport frame’s current camera?

3 Likes
1 Like

This has a bug if you click “Try in studio”, so if you view it that way, drag it into StartGui and then manually set the position of the Part inside it to (0, 0, 0)

1 Like

Thanks. It works but the part must be at 0, 0, 0 only with an orientation of 0, 0, 0 also. In short, I can’t use this on rotated, offseted parts. I need one that works with whatever cframe the part has.

1 Like

change this line:
local corner = part.CFrame:PointToObjectSpace(bipolarVectorSet[i] * part.Size / 2.0)

local corner = part.CFrame:PointToWorldSpace(bipolarVectorSet[i] * part.Size / 2.0)

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.