How do you weld a part onto a player and have the player still able to move?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

I want to add an aura to my player and when they run around I want it to follow.

  1. What is the issue? Include enough details if possible!

Right now, the aura loads in perfectly, but once I take off running the aura stays behind.

  1. What solutions have you thought of so far?

I tried using a WeldConstraint. This made the aura stick to the player like glue but as the aura rotated around it forced the player to rotate as well.

I tried changing my rotation script to follow the player. This made the aura follow the player but there was such a delay/lag with it the aura was always about 10 feet behind me until I stopped moving so it could catch up.

I played with CFrame’s and anchored properties. I think I’m probably just going about this wrong.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

Here’s what I’m doing. When the player equips an aura (button click) I take the parts that contain it and I weld them onto the player character. I have 13 auras in my game so far and this works for all but this one. This is my only aura using parts though, instead of just particle effects so I think that is the difference that is throwing me off.

Here is my weld-to-player code:

local function weldParts(source, target)
	for _, part in ipairs(source:GetChildren()) do
		if part:IsA("BasePart") then
			local correspondingPart = target:FindFirstChild(part.Name)
			if correspondingPart then
				local partClone = part:Clone()

				partClone.Parent = correspondingPart
				partClone.CFrame = correspondingPart.CFrame

				local weld = Instance.new("WeldConstraint")
				weld.Part0 = correspondingPart
				weld.Part1 = partClone
				weld.Parent = correspondingPart
			end
		elseif part:IsA("Model") then
			local correspondingPart = target:FindFirstChild(part.Name)
			if correspondingPart then
				weldParts(part, correspondingPart)
			end
		end
	end
end

And this is my script to rotate the parts and move them up and down around the player (this script hangs off the moving part itself).

local water = script.Parent

local direction = "up"
local height = 5
local low = 3

local player = nil

local function GetPlayer()
	local player = game:GetService("Players"):GetPlayerFromCharacter(water.Parent.Parent.Parent)
	return player
end

while true do
	local waistPoint
	
	if player == nil then
		player = GetPlayer()
		
		waistPoint = player.Character:WaitForChild("LowerTorso").Position.Y
		water.CFrame = player.Character:WaitForChild("LowerTorso").CFrame - Vector3.new(0, 3, 0)
	else
		waistPoint = player.Character:WaitForChild("LowerTorso").Position.Y

		if direction == "up" then
			water.CFrame = player.Character:WaitForChild("LowerTorso").CFrame * CFrame.Angles(0, math.rad(5), 0) + Vector3.new(0, 0.1, 0)
		else
			water.CFrame = player.Character:WaitForChild("LowerTorso").CFrame * CFrame.Angles(0, math.rad(5), 0) - Vector3.new(0, 0.1, 0)
		end

		if water.Position.Y > waistPoint + height then
			direction = "down"
		end
		if water.Position.Y < waistPoint - low then
			direction = "up"
		end
	end
	
	task.wait(0.02)
end

Excuse the hackiness, I get it working then clean up the code :slight_smile: Thanks for looking.

Just make the part noncollide and parent it to the character. at least i think that should work.

Just noticed that the torso was a MeshPart. I got it from the rig builder. I modified it to be a basepart like my script calls for - no luck, I didn’t notice any change.

In reply, the part is Non-Collide not anchored, transparency = 1. It is parented to the LowerTorso. I will try character directly though.

just use motor6ds.
I have worked with several star glitcher FE scripts, and they all see to use motor6ds, trying it myself worked out with having the parts hollow.

Also, in the motor6d cframe, you can change it to however you like while keeping the object in pair with the player/object.

Thanks @Klassik, I never knew about Motor6D. I just looked it up and it does sound like what I need.

There’s no code samples on the documentation so I’ll search around, but this is probably what I’m after. I’ll see if I can get it working and post my solution.

I’ve been experimenting with motor6ds and I’m now able to weld parts to my player and they can still run around. I’m still trying to figure out how to rotate and animate those welded parts but that’s another question/post :slight_smile:

Marking as answer.