Joints work in object-space coordinates. You need to be editing the C1, because the C0 should only be used to mark the joint location.
C0 is the positive "push" away from the center of Part0. This is where the two parts will be joined. C1 is the negative "push" away from C0 where Part1 will be oriented and positioned.
The following is an edited version of your code. All I did was change the area where you edit the C1 property in the coroutine. All you need to do there is get the world-space CFrame where you make the head face a position. Then, transform these coordinates to object-space. Like I said earlier, you need to reference how C1 is calculated to make sure you transform it to the right object-space.
To recap, C1 is in reference to the center of Part0 and then pushed by C0. So, in CFrame, it's
TorsoCFrame * C0
01 | player = game.Players.LocalPlayer |
02 | character = player.Character |
04 | neck = character.Torso [ "Neck" ] |
05 | originalNeckC 0 = neck.C 0. p |
06 | originalNeckC 1 = neck.C 1. p |
08 | local tool = Instance.new( "HopperBin" ,player.Backpack) |
11 | function onSelected(mouse) |
12 | print (tool.Name.. " has been selected." ) |
13 | coroutine.resume(coroutine.create( function () |
15 | neck.C 1 = (CFrame.new(character.Head.Position, mouse.Hit.p)):toObjectSpace(character.Torso.CFrame * neck.C 0 ); |
20 | tool.Selected:connect(onSelected) |
You'll probably see a bunch of free-model code (and even some mainstream developers) do it using C0, or a combination of both C0 and C1. Don't pay attention to that. They might be able to get by doing it, but that's not the correct way. It's much simpler to just figure out how joints work and then try doing editing with them.