I am working on a project for someone and they asked me to script a command where a certain rank person can say :assist and a higher rank person will be teleported to them(in game of course). At first I thought I would just use the CFrame of the player that I am teleporting to and add a certain amount to the y. However, I thought about ceilings and realized my idea was not so great after all. Is there any way I can check around a player for an empty space to spawn in. Note: I am asking for a method not a script. Thanks!
COMMUNITY QUESTION
[Solved]How can I teleport a player to another player without getting stuck in surrounding objects?
2 answers
Maybe you can use a script that will make you go threw the surrounding objects....Maybe find on YouTube? Note: Dont use AlvinBlox, people told me he's bad.
use rays and :FindPartOnRay(Ray) to calculate how big an area is then tp or disable player to player collision and do :SetPrimaryPartCFrame(Teleportingtoplayersprimarypart.CFrame)
1 comment
0
make sure its the ray hit position and not the part position
This discussion is preserved as it was. New answers, comments, and votes are closed.

8 comments
Raycasting
are you sure?
can I use a for loop and when an open space is found return that area?
is it possible to break out of a for loop?
If you change the player's HumanoidRootPart.Position, roblox will check if it has enough space, and if it dosen't it will bump up the Y axis until it does.
I would recommend when you teleport the player, add a little offset of maybe a Vector3.new(0, 0, 15). Just an idea
@incapaz, what if there's a wall at the offset?
ok thanks guys! I am planning on doing an offset after casting a ray in that direction. We will see if it works.