Hello everyone! I am writing a carrying system and have basically finished it, but for some reason when the player is being carried, the alignpositions and attachments are somewhat off each time, and other times they’re perfect, its just a weird bug and I have pictures describing what is happening here:
Both pictures were taken like 5 seconds apart but I have no idea what the issue could possibly be, here is the code I used to make the Attachments/AlignPosition:
AcceptedRequest.OnServerEvent:Connect(function(plr, requesterName)
-- REQUESTER = Carrier
-- plr = Player being Carried
local requester = Players[requesterName]
print(CarryingPlayer[requester])
if CarryingPlayer[requester] then return end
local value = Instance.new("StringValue")
value.Value = requesterName
value.Parent = plr.Character
CarryPlayer:FireClient(requester, "Carry")
CarryPlayer:FireClient(plr, "BeingCarried")
CarryingPlayer[requester] = true
local AlignPosition = Instance.new("AlignPosition")
AlignPosition.RigidityEnabled = true
AlignPosition.Responsiveness = 100
local Attach0 = Instance.new("Attachment")
local Attach1 = Instance.new("Attachment")
Attach0.Name = "PLAYER"
Attach1.Name = "REQUESTER"
local AlignOrientationBRUH = Instance.new("AlignOrientation")
AlignOrientationBRUH.Name = "YUH"
AlignOrientationBRUH.RigidityEnabled = true
AlignOrientationBRUH.Parent = plr.Character.HumanoidRootPart
AlignOrientationBRUH.Attachment0 = Attach0
AlignOrientationBRUH.Attachment1 = Attach1
Attach0.Parent = plr.Character.HumanoidRootPart
Attach1.Parent = requester.Character.Head
Attach0.WorldPosition = plr.Character.HumanoidRootPart.Position
Attach1.WorldPosition = requester.Character.Head.Position + Vector3.new(0.8, 1, 0)
AlignPosition.Attachment0 = Attach0
AlignPosition.Attachment1 = Attach1
plr.Character.HumanoidRootPart:SetNetworkOwner(requester)
SetCollisionGroupON(plr.Character)
AlignPosition.Parent = plr.Character.HumanoidRootPart
end)