- Home /
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?
Answer by DaDonik · Nov 08, 2014 at 08:11 PM
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.
Your answer
Follow this Question
Related Questions
OnTriggerExit2D doesnt work 0 Answers
How to Find Owner of a Trigger? 1 Answer
Raycast from touch, return if hit a specific object. 0 Answers
Calling function in a script based on raycast hit 1 Answer
active script from distance 3 Answers