Is there any way to set the position of the edges of a gameObject? What I want is to make a 2d line the goes from one position to another. I need to be able to do this with c# though because these positions aren’t guaranteed to stay the same.
Not fully sure what you’re looking for, but I’m assuming a kind of selection box? Which would be recommended to do with UI and script the scale of it, as Debug.DrawLine
uses up a lot of performance. Not too sure on Gizmos > Unity - Scripting API: Gizmos.DrawLine. But normally if you see anything in a game that isn’t a full-bore character, or object, it’s mainly UI. If you’re unfamiliar with UI, I strongly suggest finding tutorials on them. Brackey’s on youTube, is pretty good at explaining things. You basically make a canvas on the camera, and the canvas is where stuff gets “drawn”, text, lines, shapes, etc… And you’ll have to script them, ScreenToWorldPoint is gonna be a big usage one, that’s basically canvas to in-game world coordinates-conversion.