x


Draw a 2D line in Screen space in the scene editor

Hi there,

I was just wondering how I could draw a simple 2D line, in screen space in the scene view? Much like a gizmo but 2d. Is this possible?

Many thanks, Mike

more ▼

asked Mar 26 '10 at 04:39 PM

mike002 1 gravatar image

mike002 1
41 1 1 3

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

Also if you look at the FPS Tutorial that someone wrote at Unity (it's a great tutorial actually, I highly recommend it if you haven't already checked it out...). Anyhow, in that example and I think I saw it somewhere else in their stuff too, but they make a 'Waypoint' class. If you fly around in the project you'll notice some little yellow 'W's' in the scene near the big bot chars. If you click on one of those they have a script attached to them that does similar line drawing. You need to tell the waypoint to update it's connections to the other nearby waypoints, and once you've done that (right click menu on the 'w's' props I think) the red lines will show up in 3D space, connecting any nearby waypoints that can see each other - it does tests with raycasts to make sure the waypoints can see one another, pretty decent design.

Hope that helps too, best regards, -=VRMan3D.com=-

more ▼

answered May 17 '10 at 05:19 PM

VR Man gravatar image

VR Man
42 1

(comments are locked)
10|3000 characters needed characters left

My bet is that you are looking for something like Gizmo.DrawLine or DrawGizmo.

Once you got that one, you can start playing with values from other objects, like e.g. the scene camera functions and the objects you want gizmified.

more ▼

answered May 20 '10 at 07:36 AM

Nicolaj Schweitz gravatar image

Nicolaj Schweitz ♦♦
1.7k 19 26 57

(comments are locked)
10|3000 characters needed characters left
more ▼

answered May 07 '10 at 01:44 PM

invicticide gravatar image

invicticide
232 6 10 12

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1039
x123
x85
x69

asked: Mar 26 '10 at 04:39 PM

Seen: 5513 times

Last Updated: Mar 26 '10 at 04:39 PM