Continuing a function if its called once.

i have it to where if a certain trigger is hit by player raycast, the player moves towards trigger with mathf smooth damp. my issue is that since its only called once when the players raycast hits it, the player barely moves with smooth damp. how would i go about continuing the function until the player fully reaches trigger?

Make a bool variable, set it to false. If your trigger is hit by the raycast, set the bool to true. In the Update method check if the bool is true and smooth damp your player there. Once the player reaches the trigger, set the bool to false again.