How would I be able to make a part/npc teleport in a random position NEAR the player, WITHOUT teleporting into any obstacles (for example: trees, walls, etc).
Code samples or an explanation would be much appreciated.
Here’s 2 images for a better understanding of what I am trying to achieve.