I'm making a script that mines and then walks to the back, deposits it and walks back. I've written the script so that I can start it anywhere and it will walk to the specified coordinates and start mining again.
Here's My Problem:
since I am using GameObjects.closest(ore name here) for example, if the script detects any object matching that name along the way to the coordinates, it will try to interact with that object instead.
How can I check if my player is within a specific area BEFORE trying to interact with an object?
basically walk,walk,walk -> am I in specified area? NO(keep walking to coords) YES(look for/interact with object)