I need help with welding one part to another

So I am currently trying to weld one part to another, I tried using a weld but it didn’t work that great so now I am trying to use weld constraints and set the position before creating the constraint, but it is not working at all.

The rig’s humanoidrootpart position (Vector 3): -38.722, 3.196, 121.501
The part’s position (Vector 3): -36.47, 3.847, 121.53
The difference (Vector 3): -2.252, -7.043, -0.029

And here is my code:

local bomb = game.ReplicatedStorage.Bomb:Clone()
bomb.Parent = workspace
bomb.Position = v.Character.HumanoidRootPart.Position * Vector3.new(-2.252, -7.043, -0.029)

local weld = Instance.new("WeldConstraint")
weld.Name = "BombWeld"
weld.Part0 = v.Character.UpperTorso
weld.Part1 = bomb
--weld.C0 = CFrame.Angles(-90, 0, 0) * CFrame.new(-0.252, 2.2, 1)
weld.Parent = bomb

In your code, you are calculating the position of the bomb incorrectly. The position of the bomb should be the position of the other part plus the difference between the two positions. Try changing this line:

bomb.Position = v.Character.HumanoidRootPart.Position * Vector3.new(-2.252, -7.043, -0.029)

to this:

bomb.Position = v.Character.UpperTorso.Position + Vector3.new(-2.252, -7.043, -0.029)

This should correctly position the bomb. Additionally, if you want to weld the bomb to the other part using weld constraints, you also need to set the C0 property of the weld to align the two parts correctly. Here’s an example of how you could set the C0 property:

weld.C0 = CFrame.new(v.Character.UpperTorso.Position, bomb.Position)

It still is not working, the animation plays but the bomb is under the map and it flings my character when I move. Here is the updated code:

local bomb = game.ReplicatedStorage.Bomb:Clone()
				bomb.Parent = workspace
				bomb.Position = v.Character.UpperTorso.Position + Vector3.new(-2.252, -7.043, -0.029)

				local weld = Instance.new("Weld")
				weld.Name = "BombWeld"
				weld.Part0 = v.Character.UpperTorso
				weld.Part1 = bomb
				weld.C0 = CFrame.new(v.Character.UpperTorso.Position, bomb.Position)

				workspace.Effects.Anchored = false
				workspace.Effects.WeldConstraint.Part1 = bomb

				weld.Parent = bomb


				local animation = Instance.new("Animation")  -- Create Animation object
				animation.AnimationId = "rbxassetid://13245017538"  -- Set the animation ID
				local animationTrack = v.Character.Humanoid:LoadAnimation(animation)  -- Load the animation
				animationTrack:Play()  -- Play the animation

(By the way there is no C0 property to a weld constraint)

It looks like the bomb’s position isn’t set correctly.

bomb.Position = v.Character.UpperTorso.Position + Vector3.new(-2.252, -7.043, -0.029)

to this:

bomb.Position = v.Character.UpperTorso.Position + Vector3.new(0, -7, 0)