Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does the humanoid touched event stop working after increasing humanoid scale?

Asked by 5 years ago
Edited 5 years ago

I have a mechanic in my game where a player touches a mesh object on the ground and the mesh object disappears then the players humanoid grows a little. That all works fine at first when the humanoid is regular scale, but after the humanoid has scaled up a little bit, then the touch events stop working.

I have done a lot of testing. If I add touch event's to the humanoids feet I will start by picking up tons of terrain touched events. Once the humanoid has scaled up a bit, like a scale of 1.5 or so, the terrain touched events won't generate anymore even though I am standing on it. I have tested it by creating various parts and meshes and standing on them after scaling, and touched events will not be thrown when touching those objects either.

So I have come to the conclusion that scaling up the size of the humanoid starts breaking the touched events, but I can't for the life of me figure out why.

Here is my function that scales up the humanoid. Otherwise the humanoid is the default with nothing special done to it.

local function SetHumanoidSize(humanoid, scale)
    local Properties = {"BodyDepthScale","BodyWidthScale","BodyHeightScale", "HeadScale"}

    for _, property in pairs(Properties) do
        humanoid[property].Value = 1 + scale
    end
end
0
I finally figured out the issue. The problem only occurs when I increase the humanoids size from the client using a local script. If I increase the humanoids size from the server using a script, everything continues to work regardless of the players size. I still don't understand why though. krugman87 5 — 5y

Answer this question