#Wierd Bug?

6 messages · Page 1 of 1 (latest)

sudden helm
#

Im creating an obby where your an ice cube, you shrink over time and I have a wierd bug where they get flung? I can provide the script

print("MeltScript")

local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")

local originalSizes = {}
for _, part in ipairs(character:GetDescendants()) do
    if part:IsA("BasePart") then
        originalSizes[part] = part.Size
    end
end

local scaleProperties = {
    humanoid:FindFirstChild("BodyHeightScale"),
    humanoid:FindFirstChild("BodyWidthScale"),
    humanoid:FindFirstChild("BodyDepthScale")
}

local function updateSize()
    local health = humanoid.Health
    local maxHealth = humanoid.MaxHealth
    local scaleFactor = (maxHealth > 0) and (health / maxHealth) or 0

    for part, origSize in pairs(originalSizes) do
        if part and part.Parent then
            part.Size = origSize * scaleFactor
        end
    end

    for _, scale in ipairs(scaleProperties) do
        if scale then
            scale.Value = scaleFactor
        end
    end

    local rootPart = character:FindFirstChild("HumanoidRootPart")
    if rootPart then
        rootPart.Position = rootPart.Position - Vector3.new(0, (1 - scaleFactor) * 2, 0)
    end
end

while character.Parent do
    updateSize()
    task.wait(0.1)
end
#
while task.wait(MELT_STEP) do
    if humanoid.Health > 0 and MELT_RATE > 0 then
        local healthLoss = MELT_RATE * humanoid.MaxHealth * MELT_STEP
        humanoid.Health = math.max(humanoid.Health - healthLoss, 0)
        print("MeltSystem melting... Health:", humanoid.Health, "Melt Rate:", MELT_RATE)
    end
end
#

wth

#

other script isnt sending

cloud widget
#

could be that humanoidrootpart is getting too low to the ground

#

roblox really doesnt like that and tends to do weird physics like you describe when the hrp starts touching the ground