How to rotate weld's C1 value to make part face a position?

(Bump)

This issue further persists. I have found somewhat of a solution though.

The code in the posts works and has the correct behavior of making the arms of the character face a target position by changing the weld’s c1 offset (see below).

while true do 
	if tick() - start >= 2 then break end
	game.ReplicatedStorage.ClickAnimating:Fire()
	wait()
	local offset = CFrame.new(0,0,-0.5)*CFrame.Angles(math.pi/2,0,0)
	local p0c0 = torso.CFrame*weld1.C0

	weld1.C1 = (CFrame.new(p0c0.p, FB.Position)*offset):inverse()*p0c0
	local p0c0 = torso.CFrame*weld2.C0
	weld2.C1 = (CFrame.new(p0c0.p, FB.Position)*offset):inverse()*p0c0 
end

Editing the code provides the intended behavior I am looking for. Although this is a solution, I will not mark it as such. Although the code does edit the C1 value, it requires an offset variable. Here is a piece of code I found that does not require such offset variable.

This piece of code does not require a offset variable but the issue is that it manipulates the C0 offset instead of the C1 offset. The goal is to do what this piece of code does but to make it so it changes the C1 offset rather than the C0 offset.

Edit: If you found the solution then please do remember to explain the logic of the code in depth! Thanks!

2 Likes