#Hitbox welded to a certain part doesn't work
1 messages · Page 1 of 1 (latest)
first one is weld to that part, second one is weld to the HRP
```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)
i dunno
?💀
dont use .position and .rotation, use cframe
make massless true and cancollide false
cfrome is atomic and replicates better
also prob a networkownership problem
** You are now Level 4! **
set it to nil