#how to make humanoid root part to cover the whole body?

1 messages · Page 1 of 1 (latest)

long fjord
#

Client:

Signal.FireServer("picked up dropped item", DropItemPart.Position)

Server:

Signal.ListenRemote("picked up dropped item", function (Player, PartPos : Vector3)
        --calculates if the player is actually touching the part
      local function isTouching(aPos, aSize, bPos, bSize)
        local aMin = aPos - aSize / 2
        local aMax = aPos + aSize / 2
        local bMin = bPos - bSize / 2
        local bMax = bPos + bSize / 2

        return (aMin.X <= bMax.X and aMax.X >= bMin.X) and
            (aMin.Y <= bMax.Y and aMax.Y >= bMin.Y) and
            (aMin.Z <= bMax.Z and aMax.Z >= bMin.Z)
    end

    local Character:Model = Player.Character
    while not Character do
        Character = Player.Character
    end
    local HumanoidRootPart:Part = Character:WaitForChild("HumanoidRootPart")

    local CharPos     = HumanoidRootPart.Position
    local CharSize     = HumanoidRootPart.Size
    local ItemPos     = PartPos
    local ItemSize     = Vector3.new(1, 1, 1)

    local Touching = isTouching(CharPos, CharSize, ItemPos, ItemSize)
        print(Touching) --false, because the humanoid root part's position is not actually touching the item
end)

The problem is that the humanoid root part is only covering the chest area of the humanoid. I want it to cover the whole body so the server can accurately determine if the player actually touched the part or is there a way to get the actual position and size of the character?

long fjord
#

The reason I want to check if the player is actually touching the part is because since the request is sent by the client, i want to actually make sure the player is not exploiting by sending false requests

Signal.FireServer("picked up dropped item", DropItemPart.Position)

is triggered from Part.Touched:Connect btw

smoky walrus
#

perhaps make a second part welded to the humanoic root part as a pick up hitbox instead?

long fjord