This guide was perfect for me. Not only did I learned a few new things about Unreal, but it also helped me with other tasks I had to do after the drawing. Some of which I was not even sure of how to search for. I should point out that it seems that the "Vector2D / float" boxes seem to not exist in Unreal 5. Using "Vector2D / Vector2D" with the same number in both X and Y worked though.
Wanted to comment about the last section as there is a potential bug here for those who might want to implement offset to the crosshair in case you want to move to another location other than the center. Before you call 'Deproject screen to world' the vector 2d that is passed, you need to add the offset vector 2d to it but you need to multiply the offset vector 2d with the viewport scale. If you do not multiply the offset with the viewport scale, your shots will not be accurate and will land outside your crosshair if you move it from the center point. The only time where multiplying by the scale is bad is when we are at the center, but that means that you are multiplying the scale with a zeroed vector 2d (the offset) which wouldn't have any impact. Hope this helps in case someone runs into this issue like me.
This video taught me a few new things about Unreal, its super awesome knowing I can draw on the screen instead of relying on textures as it allows me to do some cool things with some simple math.
I can't get my crosshair lines to move further out as I move without deleting / moving the ones that show when a player is not moving As I move my crosshair lines just extend outwards but their points close to the center of the viewport don't move away.
@@benibabic2647 Doublecheck your moving both the end and beginning of each line. if they just look like there getting longer your probably just moving one end of the drawline node, and not the beginning.
@@Okaricraft In first part of tutorial we make "not moving" crosshair and then later on as we move we make it so the beginning of each line closest to screen center gets further away and in my case what happens is... the first drawn crosshair stays in the middle and then another one "which is extended" appears and then it works fine as you stop moving but the first one is still being drawn on screen.
If I go to DynamicCrosshairWidget and I set the default value of Movement Accuracy Modifier to 100000 so it goes of screen, then everything works fine as in 32:52