Odd behavior with AlignPosition

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

image

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

make sure to have


shift lock turned on and press shift to lock the camera

I am not experiencing the same thing at all.

robloxapp-20220814-1143012.wmv (1.4 MB)

If there’s no way to fix this, I’m open to any other ways you could recommend to make a part follow a player

It only happens when shiftlock is on, it works perfectly fine when it’s not

1 Like

I see what you guys are talking about now

you could set the alignposition to one attachment mode and then update the position in heartbeat

Roblox bug fixed.rbxl (35.8 KB)

local character = script.Parent

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

game:GetService("RunService").Heartbeat:Connect(function(deltaTime)
	part.AlignPosition.Position = (character:GetPivot() * CFrame.new(-6, 0, -5)).Position
end)
1 Like

The issue is with Humanoid’s AutoRotate property. Disabling fixes the issue. You can try adding a script that make sthe char face the direction of the camera

This seemed to do the trick, only issue is the same behavior occurs with AlignOrientation, but I’ll apply the same thing here and see if that works. Thank you very much.

yup you would have to also do the same for AlignOrientation set it to one attachment mode and set the cframe in the heartbeat event

would be nice if roblox staff see this bug and change the humanoid to rotate the character back to the correct orientation before things like AlignPosition and AlignOrientation do there thing

2 Likes