How to make lines anchored to nootspace positions?

Avatar
  • updated

Image 758

Problem pictured. First time setting up and using Shapes in my project and I've immediately hit a use case problem I wasn't able to find a solution to on my own. I have a UI element I want to remain a consistent size so I set the polygon's values to noots, which behaves as expected.

However when I then try to draw a line to one of those points, I can't find an option to make the line also relative to that polygon. Is there a way to make the line draw in nootspace? Or is there a different workflow expected if you want to draw shapes that 'connect' to each other?

The desired output I am seeking is that the line length is always at the polygon border edge, while the polygon is always the exact same size no matter how zoomed in/out the camera is to it. What is the expected workflow to achieve this?

Reporting a bug? please specify Unity version:
Reporting a bug? please specify Shapes version:
Reporting a bug? please specify Render Pipeline:
Built-in render pipeline
Avatar
Freya Holmér creator

currently there's no built-in way of doing conversion between screen space and world coordinates. I think the easiest way would be to use world space scaling on the radius of your hexagon, and change the radius manually based on the screen, or use a CPU side noot conversion

for reference, 1 noot = (min(Screen.width,Screen.height)/100) pixels, but the conversion from noots or pixels to meters is pretty non-trivial to do with perspective cameras unfortunately