How to Smoothly move First Person Character to target location from any starting point with obstacle avoidance

i tried this but it’s not working,i am not quite experienced with macros and functions so can you please guide me where i am wrong