Widget Destroys Itself During Character Animation?

Evening everyone, so here’s an odd one for you all:

This is a screen shot from my project, the line trace is from the character’s weapon mesh, the red circle is the aiming crosshair widget that follows the line trace hit or end locations (generated by the widget for now). The debug values show that the Player is aiming (hence the animation), that the reference to the widget in the Player character is valid, and the widget’s name, and the print screen message is to show that the widget location is updating on tick (ignore the “attack mod” messages).

The issue occurs during part of my aiming offset animation:
Untitled video - Made with Clipchamp

If the player swings beyond the limit for one side, the animation will flip to the opposite side, closer to where the Player is looking. If this happens, the Widget seems to stop working or ticking but still appears to be valid. The widget also doesn’t seem to be affected by Player inputs anymore:
Untitled video - Made with Clipchamp (1)

And finally, here’s the linetrace code from the widget:

Any help would be great with this as I’ve been trying for days to fix this.

Thanks!

Alright, so I’ve managed to figure out that this widget killing only seems to happen if the end/ hit location ends up outside of the screen. I’m still not sure why this is essentially killing the widget though…

Is there a way to check if a location is within screen space bounds (using blueprints)? That way I should hopefully be able to run a validity check.

Thanks

After talking it over with myself, I’ve come up with this check to make sure that the trace is within valid screen space and seems to have mostly fixed the issue. It still occurs occasionally but I’m guesssing that’s to do with it happening by chance between ticks or something.

Thanks me :grin: