Updating the score when the ball collides with the box trigger

Casting is for converting actor type, you have nothing to convert.

Give yourself an actual reference to the widget using the GetActorOfClass node ( assuming the widget is open ).