Boat Turret issue

I am trying to make a turret that moves to the direction of where the player clicked. The turret is welded to the boat with C0 of (0,-1,0) and the boat moves as well.

When I tried this script:

script.Parent.Turret.Weld.C0 =,mouseClick.Position)
--Where mouseClick = mouse.Hit

The turret doesn’t move to the direction of where the mouse clicked but moves in another strange direction. However, when I tried this:

--Where mouseClick = mouse.Hit

The turret actually does move to the direction of where the mouse clicked but the whole boat moves with the turret. I want the turret to be ‘isolated’ from the boat while the turret moves to the direction of where the mouse clicked.

Any help can be appreciated!


C0s and turret?


btw welds and Motor6D s share C0 and C1 so this resource I made should work, also the issue is that C0 is in object space relative to the part0 CFrame inversing or to ObjectSpace will be needed to convert world CFrame to weld C0 CFrame

Btw, part0 is the turret and part1 is the mount/boat. C1 is not set manually but C0 is set manually. The turret and mount are welded by a script.

So I tried to convert the mouseClick CFrame (world CFrame) to a CFrame that is relative to the turret but the turret still ends up facing in the wrong direction.

script.Parent.Turret.Weld.C0 =,mouseClick:ToObjectSpace(script.Parent.Turret.Weld.C0).Position)

I can try using the TurretController maybe. But I’m gonna see if I can still find a solution to the weld and any help can be appreciated!