So I’m trying to make air combat with align position, and it’s not working as I intended it to.
Code for my align position (test script)
-- Assuming you have two dummy parts named Dummy1 and Dummy2
local dummy1 = workspace.airRig1
-- Create AlignPosition instance
local alignPosition = Instance.new("AlignPosition")
alignPosition.ApplyAtCenterOfMass = true -- Apply the alignment at the center of mass
alignPosition.RigidityEnabled = true -- Enable rigidity to keep the dummies in place
alignPosition.Mode = Enum.PositionAlignmentMode.OneAttachment
alignPosition.MaxForce = 10000 -- Adjust the force as needed
-- Set the desired offset in the y-axis (vertical axis) to lift the dummies
local yOffset = 20
alignPosition.MaxVelocity = math.huge
alignPosition.Responsiveness = .1
-- Attach AlignPosition to both dummies
alignPosition.Attachment0 = dummy1.HumanoidRootPart.RootAttachment
local tween = game:GetService('TweenService'):Create(alignPosition, TweenInfo.new(.5, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut), {Position = (dummy1.HumanoidRootPart.CFrame * CFrame.new(0,20,0)).Position})
task.wait(2)
tween:Play()
alignPosition.Parent = dummy1.HumanoidRootPart.RootAttachment
-- Optionally, you can destroy the AlignPosition instance after applying if you don't need it anymore
game.Debris:AddItem(alignPosition, 2)
Video of result:
Please help and explain why is this happening?