- Home /
GUI lines with different possible lengths and angles
Hey all,
I'm doing a pin system on 3D objects where you define a 3D point on it, and there is 2D GUI that has a little pin there, and a line to a bigger button.
The two pins can be represented on the screen easily, but I'd like a simple black line connected them. Since the 3D object can be rotated, the pins will change in position and distance, and the line between them would change accordingly.
What's the easiest way to represent this line?
Answer by Berenger · May 17, 2012 at 02:10 AM
There might be better ways, but you can try that.
Any idea how this works? I'm trying to do something simple, like have one Vector2 be the center of the screen, and the other be my mousePosition, but it acts CRAZY, changing angle and position, not attached to the center nor my mouse cursor.
Apparently it draw a pixel then it rotates it and scale it. I've never used it though. I'll move my answer to the comments if you want.
I just don't understand why Unity has so much built-in but nothing for simple GUI lines. -_-
I'll try to figure out how to use this properly, thanks for the tip.
Your answer

Follow this Question
Related Questions
How to create a 2D line between a Game Object and the mouse? 0 Answers
Store/Stack Items 0 Answers
Multiple canvases and graphic raycasters 1 Answer
Using a screen-drawn line to check for a collision [Vectrosity] 5 Answers
Bad result of changing RectTransform values (Anchor Preset) programmatically 0 Answers