Here's my idea:
- *create 3 empy game objects, each with a long trigger box, facing forward/front left/front right out from player
- You can check collisions with these to check if anything is: directly in front of the player, just to the forward left of the player, just to the forward right of the player
- when you click give the player a waypoint to move toward/rotate to face
- if anything collides with the "forward trigger box", then check if anything is colliding with the forward right/forward left trigger boxes (if not then it could walk around the object)
- so whichever one doesn't register collision, rotate the game object in that direction until forward trigger box is no longer colliding
- then resume rotating the player toward the waypoint you set to move toward
- IF all 3 triggers collide or a problem occurs (we cant get past easily), then just stop the player moving
So basically if a small object like a tree or rock is in the way of the player, he will walk around it. If a bigger object is in the way he will stop.
* triggers are faster than 3 raycasts every frame, parent these to player