Part not positioning correctly when welded

local splatterPiece = game.ServerStorage.bloodSplatterBrick:Clone() --creating particle emitter
		
		local weld = Instance.new("ManualWeld") --creating the weld between your body and the part
		weld.Part0 = hit.Parent.Torso
		weld.Part1 = splatterPiece
		weld.Parent = weld.Part0
		splatterPiece.Position = hit.Position
		
		splatterPiece.Parent = hit.Parent

hit in our case would be a players body part
i want to position this bloodsplatter piece where the body part is and then weld it to the torso

it is being created and welded to the torso, but not being put in the right position…?
its positioned like
dead center of my torso…?

NOTE: i should mention this is in a touched event. hit is just what hit usually is for touched events lol (whatever touched the part)

What do you mean not in right position? Can you provide some screenshots to what you mean?

How are you calculating the variable ā€˜hit’?

Weld has to properties to calculate the position of where the gun will be welded to.

In this case you can either go for the new WeldConstraint

        local weld = Instance.new("WeldConstraint") --creating the weld between your body and the part
		weld.Part0 = hit.Parent.Torso
		weld.Part1 = splatterPiece
		weld.Parent = weld.Part0
		splatterPiece.Position = hit.Position
		
		splatterPiece.Parent = hit.Parent

or create a weld and offset it using CFrame:ToWorldSpace and C0 property

        local weld = Instance.new("Weld") --creating the weld between your body and the part
		weld.C0 = hit.Parent.Torso.CFrame:PointToWorldSpace(hit.Position)
		
		weld.Part0 = hit.Parent.Torso
		weld.Part1 = splatterPiece
		weld.Parent = weld.Part0
		
		splatterPiece.Parent = hit.Parent

All in all it really depends on how you are calculating the hit Variable. If it still doesn’t work I suggest you show us what it is.

2 Likes
this is the fix
local splatterPiece = game.ServerStorage.bloodSplatterBrick:Clone() --creating particle emitter
		
		local weld = Instance.new("ManualWeld") --creating the weld between your body and the part
splatterPiece.Position = hit.Position
	
splatterPiece.Parent = hit.Parent
		weld.Part0 = hit.Parent.Torso
		weld.Part1 = splatterPiece
		weld.Parent = weld.Part0
		```

i thought i explained this in the post but apparently not…? ill go back and edit it

by ā€œnot in the right positionā€ i mean its positioned dead center inside of my torso

its a touched event hit just happens on its own its whatever touched the part right

im not exactly sure what you did here here, but im assuming the only changed was moving the positioning line to before the welding process begins, and if that is the case, no, that does not work

weld constraints work perfectly, awesome!

but what exactly are the differences between weldconstraints and welds…? ive looked it up but im not sure i understand so
try to keep it simple

As stated, Welds put both Parts at the same position, unless you offset the Weld using CFrames like in the second script @koziahss posted.

1 Like

Yeah. Unfortunately The new WeldConstraints are a bit buggy and if you move one part by changing its position manually the welded parts don’t move.

But with normal welds you can.

Welds are basically a more better version but harder to use.