Fixing the small landing bounce when the legs are removed and the HipHeight is altered?

In my game I remove the legs of an R15 Character and change the hip height with the code below

function DestroyLeg(Character, Leg)
    Character[Leg.."Foot"]:Destroy()
    Character[Leg.."LowerLeg"]:Destroy()
    Character[Leg.."UpperLeg"]:Destroy()
end
DestroyLeg(Character, "Left")
DestroyLeg(Character, "Right")
Character.Humanoid.HipHeight = .1

Once this code is run, whenever I jump and land my character bounces slighty.

The Character is supposed to be above the ground by .1 studs as if I set the HipHeight to 0 it’ll be pushed about.

Does anybody have any ideas to fix the small landing bounce? Though it doesn’t ruin gameplay, I’ve noticed it so others would as well which is why I’d like to fix it.

This might fix it:

local defaultPhysProp = PhysicalProperties.new(Enum.Material.Plastic)
for _, part in next, character:GetDescendants() do
    if part:IsA"BasePart" then
        part.CustomPhysicalProperties = PhysicalProperties.new(defaultPhysProp.Density, defaultPhysProp.Friction, 0)
    end
end
1 Like

That didn’t fix it, I couldn’t notice any difference.

You could also try just resetting the HRP’s vertical velocity to 0 when landing.

local Humanoid = -- humanoid here
local Root = -- HumanoidRootPart here

Humanoid.StateChanged:Connect(function(_,state)
    if state == Enum.HumanoidStateType.Landed then
        Root.Velocity = Vector3.new(Root.Velocity.X, 0, Root.Velocity.Z)
    end
end)

I feel this would be a hacky way of doing it though, and it might create more problems than answers.

3 Likes

Fixed the problem!

Tthough the player seems to hover down just before it touches the ground now, that’s only noticeable when you’re really paying attention but it doesn’t look bad so I can live with that.

Thanks so much!

1 Like

You could try setting the HRP’s velocity a frame or two later or set the vertical velocity to something less than 0, like -5 or so. This would only work if the Landed event fires early though.

I also realize that this is useless optimization, but it could still be considered important later on…