What are the methods avaiable to draw lines in unreal engine?

See if this can push you in the right direction:

The first point is drawn where the camera is, the second is drawn 200 uus in front of the camera and converted back to 2d - a small pure function so we do not need to spam the same nodes all over again.

From a side, it would look like this:

Are we even still going the right direction?


Btw, when I tried to do it with a component, it was all over the place and I have little mental stamina left to wrangle its transforms.

Yes this is what i needed and trying to accomplish…since i am using widget component i was trying to find a way to find a widget itself. (here it is Line_widget). As using widget as component have problem, i am now trying to access the widget into the blueprint. So in the below image as far as I understood, the red marking is widget component and the green box is using the widget itself, right ?

if this is clear then I can implement what you said above as a function and project the line.

If you got rid of the component (remove the component from sedan), you could add a regular widget like so:

You can even use the same variable as before.

1 Like

Yes i got it now…I removed the widget component from the sedan blueprint and added the widget directly so now i get the line from the camera_front location. Now need to adjust the other points to get a line…i guess now it is ok

1 Like

image

The above hard coded values will not work, it’s time to:

image

… or you can cheat …

Add some dummies. Draw lines between their world locations. They are attached to the camera and will move with it, but can also move independently.

1 Like

Thanks for the insight…i will do it and get back here with the feedback…i guess it will work and the default location is relative, right ? Or do i need to change it to world location from the transform tab ?

They should be relative to the camera as default, as they are here. But when you access them you ask for world location, identical to what you already to do with the camera.

This should really be done with vector math.

1 Like

Yes now got it…with the usage of getworldtransform the dummies position changes to world transform. I will try the function you made and see how it goes…Thanks for your time and i guess its around 88 comments in this post… :grinning: :grinning:

1 Like

Hey, now able to draw line but as you said earlier, basically as it draws on the screen, its thickness changes and also not occluding when the camera goes in far view. Also it takes some time to update the positions when spanning the camera speedily.

So i think i have to look for other methods for my purpose

I see what you did there @Everynone !

Hee hee!

hee… about 1 year later… hee…

:zap: :heart: :zap:

Rama

2 Likes