I’m trying to make a combat feature where players can pick up other players or NPCs and carry them around. This is what it’s meant to look like.
This is what it looks like after the initial pickup animations play for both character. After these animations finish, an idle animation is played, and they’re humanoid root parts are connected with align position and align orientation. This is the code for it too.
carried.Stopped:Wait()
-- t = being carried.
task.wait(); tHumPart.CFrame = hrp.CFrame
carriedIdle:Play(); carrierIdle:Play(); -- play their idle animations
hrp.Anchored = false
tHumPart.Anchored = false
functions.SetOwnership(target, player) -- set network ownership because yes
tHum:ChangeState(Enum.HumanoidStateType.GettingUp)
tHum.PlatformStand = true
-- attachments and stuff
alignPos = Instance.new("AlignPosition")
alignOri = Instance.new("AlignOrientation")
att1 = Instance.new("Attachment", tHumPart) -- root part of the player who is being carried
att2 = Instance.new("Attachment", hrp) -- root part of the player who is carrying
alignPos.Name = "carryWeld"
alignOri.Name = "rotWeld"
alignOri.Attachment0 = att1
alignOri.Attachment1 = att2
alignOri.RigidityEnabled = true
alignOri.Parent = tHumPart
alignPos.Attachment0 = att1
alignPos.Attachment1 = att2
alignPos.RigidityEnabled = true
alignPos.Parent = tHumPart
As you can see in the video, this results in not only the position of the player on top being wrong, but they are also rigid and don’t move with the person carrying them. To solve this, I’ve tried to connect them with the humanoid root part of the person being carried, and the upper torso of the person carrying in order to make a more realistic effect like this
att1 = Instance.new("Attachment", tHumPart) -- 'root part of the player who is being carried'
att2 = Instance.new("Attachment", character.UpperTorso) -- the uppertorso 'of the player who is carrying'
However, this results in the position still being off. It’s more realistic and the player on top properly moves with the player carrying them, but I’m looking for a way to make the position correct like the first image.
How would I do this? Is using Align Position & Orientation the right method? Should Weld’s be used instead or Motor6ds, or should I be connecting the attachments to different body parts? Cheers