How to make player not move too close to walls when using move to

Thank you very much ! I thought no would ever answer this. I’ll try your solution and I’ll update you if I got it to work.