Aligning Position

From my previous post : Help with CFrame And rotating
I want to make a part follow the player similar to the pet system that someone recommended me in that post

I am like really bad with these attachments and 3d values etc

I somewhat doesn’t work and sometimes when the character jumps the part drops to the void.

			local Model 
			if Model then
			local att1 = Instance.new("Attachment")
				att1.Name = "Attachment1"
				att1.Position = PetModel:FindFirstChild("AttachmentPosition").Value
				att1.Parent = Player.Character.HumanoidRootPart
			local att0 = Instance.new("Attachment")
				att0.Name = "Attachment2"
				att0.Parent = Model.PrimaryPart
				
				local alingpos = Instance.new("AlignPosition")
				alingpos.Attachment0 = att0
				alingpos.Attachment1 = att1
				alingpos.RigidityEnabled = false
				alingpos.MaxForce = Model .MaxForce.Value
				alingpos.Responsiveness = Model.Responsiveness.Value
				alingpos.Parent = Model.PrimaryPart
				
				local alingorientation = Instance.new("AlignOrientation")
				alingorientation.Attachment0 = att0
				alingorientation.Attachment1 = att1
				alingorientation.RigidityEnabled = false
				alingorientation.MaxTorque = Model.MaxForce.Value
				alingorientation.Responsiveness = Model.Responsiveness.Value
				alingorientation.Parent = Model.PrimaryPart
				
				
				
				
				
			
			
			Model.Parent = workspace
				Model.PrimaryPart:SetNetworkOwner(Player)
				
				game:GetService("RunService").Heartbeat:Connect(function()
					
					
					att0.Position = Model.AttachmentPosition.Value
					alingpos.MaxForce = Model.MaxForce.Value
					alingorientation.MaxTorque = Model.MaxForce.Value
					alingpos.Responsiveness = Model.Responsiveness.Value
					alingorientation.Responsiveness = Model.Responsiveness.Value
					
					
				end)

the part should be next to or somewhere aound the player and not inside and acting like that

1 Like

I think it would be much easier to use a WeldConstraint.