Enable Input and disabling input using raycast detection

Hi my name is Divine, And I’m new to ue4 and blueprin.
Ok so I tried to make a simple detection system using raycast, that when ever the ray hits an actor it will show a message like (“use”, “press F”, “Open”, “take”, etc.) I got a few problems with it at first because I use toggle visibility instead of the set visibility. So I got the message flashing like hell cause its toggling on and off so fast. It seems like I got it workin fine with this graph(with the help of a community member). Though I’m still not sure if this is the most efficient way to do this.

Now my problem is about enabling/disabling input for the player, so I can press a key to toggle light on and off. I tried to enable input after the custom event node, so the input will only be enabled when the ray is hitting the actor. I also tried to put the disable input node. so I cant toggle the light with the actor if I’m not hitting it with the ray. but its not workin :frowning:

I tried to remove the disable input and the enable input works. but since I removed the disable input once the ray hit the actor it enables the input permanently which makes the character toggle the light on/off even if the ray is no longer hitting the actor. I hope you guys can help me.