Align Position Bug

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?

I want to fix a bug with Align Position

  1. What is the issue?

After AlignPosition is destroyed, when the player jumps while moving, they’re sent speeding away

  1. What solutions have you tried so far?

I have tried resetting the humanoid’s velocity after the AlignPosition is destroyed and setting MaxVelocity and MaxForce to 0. And yes, I looked on developer hub

this is the function:

function module.grab(attacker:Model, victim:Model)
local att_hrp = attacker:FindFirstChild(“HumanoidRootPart”)
local vic_hrp = victim:FindFirstChild(“HumanoidRootPart”)

local weld = Instance.new("AlignPosition")
weld.Attachment1 = att_hrp.RootAttachment
weld.Attachment0 = vic_hrp.RootAttachment
weld.Enabled = true
weld.Parent = att_hrp
weld.RigidityEnabled = true

game.Debris:AddItem(weld, 10)

weld.Destroying:Connect(function()
	vic_hrp.AssemblyLinearVelocity = Vector3.new(0, 0, 0)
	vic_hrp.AssemblyAngularVelocity = Vector3.new(0, 0, 0)
end)

return weld

end

and a video

It’s not a great idea to use variable names like weld to describe an AlignPosition.

Check to see if the Velocities are actually being set to 0,0,0 first while testing.

Also try putting a print in the weld.Destroying function to see if it’s firing.

Where is the AlignPosition being set to before it’s destroyed after 10 seconds? That might be sending you off in the direction you’re going.

I did the prints and the destroying function is being fired and the velocities are changing.
What do you mean by where the AlignPosition is being set to?

It looks like you are setting the AlignPosition to the opponent’s HRP?

Where are you Destroying the AlignPosition?

Why wait 10 seconds before adding it to Debris?

Yeah, attachment 0 is set to the opponent. I’m destroying it any script I’m using it in, after the attack is finished. Like this for example (weld is the AlignPosition):

user_track.Stopped:Wait()
t_hrp:SetNetworkOwner()

if user_special.IsPlaying == false then
	user:SetAttribute("InAttack", false)
	weld:Destroy()

	stun_mod.unstun(user)

	t_hrp.CFrame = target.Torso.CFrame
	t_hrp.Anchored = false
	target:SetAttribute("InAttack", false)
	damage_mod.fling(target, us_hrp.CFrame.LookVector * 200 + Vector3.new(0, 300, 0))
end

Destroying it in 10 seconds was an attempt to fix the issue, but that didn’t work lol.

I just noticed that if the Attacker gets another AlignPosition from something else, the opponent will no longer have the problem. I don’t know if that means anything, but I thought it was worth noting.

Maybe search the opponent and click on the AlignPosition while testing and see if it’s still there after the attack happens.