ok so basically I extended a hitbox for my spear weapon and now for the first time I equip it I get teleported to its location in workspace and whenever I swing it i get flung. I think this is because the hitbox collides with the ground but I set the hitbox to massless, unanchored, transparency 1, and cancollide false, here is my code:
-- Hitbox detection
local function onTouched(part)
local char = part:FindFirstAncestorOfClass("Model")
if not char or char == player.Character or debounce[char] then return end
local humanoid = char:FindFirstChildOfClass("Humanoid")
if humanoid and humanoid.Health > 0 then
humanoid:TakeDamage(DAMAGE)
debounce[char] = true
end
end
local conn = hitbox.Touched:Connect(onTouched)
-- Enable hitbox for short window
task.delay(SWING_WINDOW, function()
if conn then conn:Disconnect() end
end)
end
end)
** You are now Level 1! **