GUI Icon Constraint

I’ve noticed how in some games, they labeled places with an icon.

I’m unsure if this is a billboard or a regular gui using :WorldToScreenPoint but I like the idea of how when you’re turned away from the location, the gui stays on your edge of your screen. I was wondering how I could replicate this?

Also it scales to make it look the same size no matter how close/far you are. How is this done?

3 Likes

There isn’t a setting to make them visible on the edges of your screen while looking away; developers have to manually implement this feature if they want it.

Mathematically you project the points of interest onto the view plane of the player and then cull it. If any points are culled, then the intersection of the line segment from the center of the view plane to the point and the edge of the screen is found and the icon is displayed adjacent to that intersection. To make the result prettier, overlapping icons can be placed in the next nearest available screen space. Points not culled have an icon displayed precisely at their location. The actual size in pixels of the icons never changes, although you could have it do so. Also, by using billboard GUIs while the point is not culled, objects can obscure the icon if that is desired.

1 Like

Wait so are they using billboards or no?

regular gui using :WorldToScreenPoint

8 Likes

always happy to help! i’ve made aswell a version that shows where players are.

1 Like

Check out this module hosted by Anaminus