Skip to main content

HumanoidTeleportUtils

Utility for teleporting humanoids

Functions

identifySafePosition

HumanoidTeleportUtils.identifySafePosition(
positionPosition,
raycasterRaycaster?--

Optional raycaster

) → (
boolean,--

True if safe

Vector3?--

Position if we can hit it

)

Finds a safe position to teleport a humanoid. This searches some amount around the position to try to ensure a free space for the humanoid.

teleportRootPart

HumanoidTeleportUtils.teleportRootPart(
humanoidHumanoid,
rootPartBasePart,
positionVector3
) → ()

Teleports a humanoid to a given location.

info

You should call this on the machine that has network ownership. For characters owned by a player, this is generally the player who's character it is.

For NPCs, this should generally be the server.

teleportParts

HumanoidTeleportUtils.teleportParts(
humanoidHumanoid,
rootPartBasePart,
parts{BasePart},
positionVector3
) → ()

Teleports a humanoid to a given location including all attached parts

tryTeleportCharacter

HumanoidTeleportUtils.tryTeleportCharacter(
characterModel,
positionVector3
) → ()

Tries to teleport the character to a given position

Show raw api
{
    "functions": [
        {
            "name": "identifySafePosition",
            "desc": "Finds a safe position to teleport a humanoid. This searches some amount\naround the position to try to ensure a free space for the humanoid.",
            "params": [
                {
                    "name": "position",
                    "desc": "",
                    "lua_type": "Position"
                },
                {
                    "name": "raycaster",
                    "desc": "Optional raycaster",
                    "lua_type": "Raycaster?"
                }
            ],
            "returns": [
                {
                    "desc": "True if safe",
                    "lua_type": "boolean"
                },
                {
                    "desc": "Position if we can hit it",
                    "lua_type": "Vector3?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 24,
                "path": "src/humanoidteleportutils/src/Shared/HumanoidTeleportUtils.lua"
            }
        },
        {
            "name": "teleportRootPart",
            "desc": "Teleports a humanoid to a given location.\n\n:::info\nYou should call this on the machine that has network ownership. For characters\nowned by a player, this is generally the player who's character it is.\n\nFor NPCs, this should generally be the server.\n:::",
            "params": [
                {
                    "name": "humanoid",
                    "desc": "",
                    "lua_type": "Humanoid"
                },
                {
                    "name": "rootPart",
                    "desc": "",
                    "lua_type": "BasePart"
                },
                {
                    "name": "position",
                    "desc": "",
                    "lua_type": "Vector3"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 69,
                "path": "src/humanoidteleportutils/src/Shared/HumanoidTeleportUtils.lua"
            }
        },
        {
            "name": "teleportParts",
            "desc": "Teleports a humanoid to a given location including all attached parts",
            "params": [
                {
                    "name": "humanoid",
                    "desc": "",
                    "lua_type": "Humanoid"
                },
                {
                    "name": "rootPart",
                    "desc": "",
                    "lua_type": "BasePart"
                },
                {
                    "name": "parts",
                    "desc": "",
                    "lua_type": "{ BasePart }"
                },
                {
                    "name": "position",
                    "desc": "",
                    "lua_type": "Vector3"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 86,
                "path": "src/humanoidteleportutils/src/Shared/HumanoidTeleportUtils.lua"
            }
        },
        {
            "name": "tryTeleportCharacter",
            "desc": "Tries to teleport the character to a given position",
            "params": [
                {
                    "name": "character",
                    "desc": "",
                    "lua_type": "Model"
                },
                {
                    "name": "position",
                    "desc": "",
                    "lua_type": "Vector3"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 116,
                "path": "src/humanoidteleportutils/src/Shared/HumanoidTeleportUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "HumanoidTeleportUtils",
    "desc": "Utility for teleporting humanoids",
    "source": {
        "line": 5,
        "path": "src/humanoidteleportutils/src/Shared/HumanoidTeleportUtils.lua"
    }
}