#Hitbox welded to a certain part doesn't work

1 messages · Page 1 of 1 (latest)

burnt shuttle
#

I added a part to my character that tries to put itself in front of the character to make the game more smoother on higher ping
the issue is it just doesn't work when using that part, if the hitbox is attached to the HRP it works fine but not with the part

#

⁨```lua
function Module.ActivateExtender(Character : Model)
task.spawn(function()
local Scale = 4

    local HRP = Character:FindFirstChild("HumanoidRootPart")
    local Extender = HRP:FindFirstChild("Extender")
    if not Extender or not HRP then return end
    Extender.Anchored = true
    Extender.Weld.Enabled = false

    local LastPosition = HRP.Position

    RunService.Heartbeat:Connect(function(dt)
        local Velocity = (HRP.Position - LastPosition) / dt
        local Speed = Velocity.Magnitude

        local Distance = Speed / Scale

        local Direction

        if Velocity.Magnitude > 0 then
            Direction = Velocity.Unit
        else
            Direction = HRP.CFrame.LookVector
        end

        Extender.Position = HRP.Position + Direction * Distance
        Extender.Rotation = HRP.Rotation

        LastPosition = HRP.Position
    end)
end)

end```⁩
the script that controls that part (extender)

fast elbow
#

i dunno

languid plover
tawny hawk
#

dont use .position and .rotation, use cframe

#

make massless true and cancollide false

#

cfrome is atomic and replicates better

#

also prob a networkownership problem

normal dustBOT
#

studio** You are now Level 4! **studio

tawny hawk
#

set it to nil