PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

DistanceFromCharacter

Returns the distance between the character’s head and the given Vector3 point. Returns 0 if the player has no character.

Parameters

Name Type Default Description

Returns

Return Type Summary

Code Samples


Player:DistanceFromCharacter

This code will print the distance of each player’s character from the origin (0, 0, 0):

for _, player in pairs(game.Players:GetPlayers()) do
    print(player:DistanceFromCharacter(Vector3.new(0, 0, 0)))
end