I am in the process of making the turret head of my warship to turn and face the mouse position using body gyro (for the smooth following action when you move your mouse) and a hinge for rotation.? (Idk if the hinge is part of the problem or not)
The issue is that I have no idea how to do it properly and I am stuck.
I have tried using the methods on Youtube and DevForum like bodygyro.CFrame = CFrame.new(mouse.Hit.Position.X, part.CFrame.Y, mouse.Hit.Position.Z)
but with no success…
Finally got it to work! Big thanks to @EsplishData for showing me my mistakes. For any future viewers, here is what I did:
local invisBox = game.Workspace.testHeadmodel.Invisbox
local mouse = game.Players.LocalPlayer:GetMouse()
local bodygyro = invisBox.BodyGyro
while wait() do
bodygyro.CFrame = CFrame.new(bodygyro.Parent.Position ,Vector3.new(mouse.Hit.Position.X, invisBox.Position.Y, mouse.Hit.Position.Z) )
end