How do I draw a widget at the end of a line trace?

I want to have a crosshair at the end of the line trace coming from my gun - not a crosshair in the centre of the screen. I cant for the life of me workout how to get draw the widget at the line trace hitpoint.

I can simply add ‘Spawn emitter at location’ and plug it in to the line trace out hit location and that does exactly what i’m looking for, only I dont want an emitter, I want the crosshair that I have designed which is available as both texture and a widget.

Super new, so would love and ELI5 version of the answer

use 3d widget component. Place it at line trace hit point.

1 Like

3D widget does make sense, but will scale the crosshair depending on distance to the hit location, which may not be desirable.

With a regular widget you should be able to use something like this I think:

Not in screenspace, it will not. @TARS_Endurance Either use a component, or convert world location to screen space for a regular widget.

If it’s just a simple crosshair, you could instead use the HUD class. It can draw stuff on top of everything, and quite efficiently to boot.

1 Like