Hi! I am trying to attach a turret to a part using welds, however, there’s a problem when changing the C0. Here’s the issue:

See, the turret isn’t where my mouse is pointing at. Here’s the code I am using:

```
local function heartbeat(delta)
local original = motor.C1:Inverse()
local rotX,rotY,rotZ = original:toOrientation()
local mouse_hit = original:toObjectSpace(mouse.Hit)
local mouse_pos = mouse_hit.p
local rot = v3new(mouse_pos.x,mouse_pos.y,mouse_pos.z)
local aimCF = lookAt(pivot.Position,rot);
local x,y,z = aimCF:toOrientation()
x = (sign(x) == 1 and x > xMax and xMax) or (sign(x) == -1 and x > xMin and xMin) or (x)
y = (sign(y) == 1 and y > maxAngle and maxAngle) or (sign(y) == -1 and y < -maxAngle and -maxAngle) or (y);
local c0 = motor.C0:Inverse()
local p = pivot.Position
aimCF = cf_new(p)*(fromOrientation(x,(y+rotY),0))
motor.C0 = aimCF:Inverse()
end
runService.Heartbeat:Connect(heartbeat)
```

Any help will be appreciated, thank you!