Hi, I wanted to remove any velocity that was created by the BodyPosition in a part when I am done with it. Even after I remove the BodyPosition from the UpperTorso, the character still has velocity in the Torso and I want to remove this. How do I do this?
Code:
local flying = false local anim = Instance.new("Animation") anim.AnimationId = "rbxassetid://1527259193" local flyAnimTrack = char.Humanoid:LoadAnimation(anim) mouse.Button1Down:connect(function() local bp = Instance.new("BodyPosition", char.UpperTorso) flying = true bp.MaxForce = Vector3.new(4000, 4000, 4000) bp.Name = "LegoFlyPosition" bp.Position = mouse.Hit.p char.Humanoid.AutoRotate = false flyAnimTrack:Play() mouse.Move:connect(function() if flying == true then bp.Position = mouse.Hit.p char.UpperTorso.CFrame = CFrame.new(char.UpperTorso.Position, mouse.Hit.p) end end) end) mouse.Button1Up:connect(function() char.UpperTorso.LegoFlyPosition:Destroy() char.Humanoid.AutoRotate = true flyAnimTrack:Stop() flying = false end)