Hi Narayani,
The way I would set this up is using a float value that you increment as long as the player is looking at the object. Once the desired float value is achieved, it allows you to continue with your function. If your trace no longer hits the actor, reset the float to 0.0. You could set it up like this:
