Odd behavior with AlignPosition

I’m using AlignPosition to make a Part follow the player’s HumanoidRootPart. It works fine, for the most part, however, some odd behaviour occurs whenever the player jumps backwards or to the side while shift-locked as seen in the streamable below.

local amplitude = 0.3 
local magnitude = 3 

local partModel = script.Parent

local char = workspace:WaitForChild("Gizen_K")

script.Parent.Part.Anchored = false
local modelSize = partModel.PrimaryPart.Size


local attachmentChar = Instance.new("Attachment", char.HumanoidRootPart)
attachmentChar.Visible = true
attachmentChar.Position = (Vector3.new(-4, 0, -3) + modelSize)

local attachmentModel = Instance.new("Attachment", partModel.Part)
attachmentModel.Visible = true

local alignPosition = Instance.new("AlignPosition", char.HumanoidRootPart)
alignPosition.Attachment0 = attachmentModel
alignPosition.Attachment1 = attachmentChar
alignPosition.Responsiveness = 25

--[[local alignOrientation = Instance.new("AlignOrientation", char.HumanoidRootPart) 
alignOrientation.Attachment0 = attachmentModel
alignOrientation.Attachment1 = attachmentChar
alignOrientation.Responsiveness = 25


	attachmentChar.Position = (Vector3.new(-4, 0, -3) + modelSize) + Vector3.new(0, amplitude*math.sin(tick()*math.pi/magnitude), 0)

this does not look like a problem with AlignPosition but a problem somewhere else

do you have RigidityEnabled turned on? It applies the strongest force possible basically acting like a weld

Tested with RigidityEnabled on and off, same result

Tested to see what else could be affecting it, I’m pretty sure it’s AlignPosition

and what about the collisions of the box?

the issue is definately not with allign position alone. Theres something else going on

I’ll narrow down the code in my post to just AlignPosition, the collisions of the box are off and it’s set to massless.

so i just tried manually putting attachments on my character in game and it works perfectly fine. I put one attachment in the HumanoidRootPart and the other is on a random Part.

did this with position and orientation both set to RigidityEnabled

could you show us the Explorer with the part you are attaching, the character, and the attachments?

I think this might be a problem with Roblox’s humanoid system not the alignposition

what I think is happening within the frame the character is rotating then the attachment moves
then the align position tries to align the position
then the humanoid system rotates the character back

That shouldnt be a problem because if you try it in game rn it works perfectly. And its massless as well so it shouldnt affect the player whatsoever

Is that the only script in the game? If it is id say maybe try swapping the attachment0 and 1 values see if that yeilds any new results. Highly unlikely this will fix though

i did try it in game make sure to lock the camera and jump in a direction that’s not forward here is my project i tested

Roblox bug.rbxl (35.8 KB)

and this is the only script in the project

local character = script.Parent

local attachment = Instance.new("Attachment")
attachment.Visible = true
attachment.Position = Vector3.new(-6, 0, -5)
attachment.Parent = character.HumanoidRootPart

local part = game.ReplicatedStorage.Part:Clone()
part.AlignPosition.Attachment1 = attachment
part.Parent = workspace

your example works perfectly fine for me. Turn RigidityEnabled on for the allign position

what if we don’t want RigidityEnabled and i also tested with it set to true and there is still the problem

Then the align position is working as intended. Theres no bug. OP said it didnt work even with rigidity enabled on

he is correct it does not work with RigidityEnabled as well i just tested it now


see there is a small offset when jumping right

I tried his example and it’s the exact same issue. Even with RigidityEnabled you can see the part shifts slightly away from its intended position whilst jumping and strafing.

What issue are you experiencing? Im playing the exact game you sent and it works perfecly fine. The box is exactly where it should be. Even when i spin like crazy and jump