dynamic croshairs

hi guys so basically i am making a dynamic crosshair for my game that changes colour and size etc to let the player know when they are targetting something. just wondering what the best approach is ?? i have a system working but it uses a sphere trace on tick event so im just worried about performance issues or if there is an easier/better way to do this. heres my setup

in my character i do a sphere trace from the player camera towards the crosshair. i used sphere because i tried linetrace first but found the line trace too narrow and often doesnt change the crosshair colour at the right time .


then i check to see if the thing the line trace hits has the tag “player” if so then it sets the lineTraceHasHitVariable to true.

then in my widget i have two functions . one to set the colour of the crosshair to green and then another to change it back to red like so.


here is the result