So I'm experimenting with SetPrimaryPartCFrame(), trying to make some remote controlled gun but having issues.
As far as I know, a CFrame value includes: Position, Orientation. That's one confusing thing and that's what I've done.
I want to make the remote controlled gun stay in it's position but rotate to the camera.
So I'm doing CIWS:SetPrimaryPartCFrame(CIWS:GetPrimaryPartCFrame().p, Camera.CFrame.lookVector)
the entire script that moves the gun is this:
RunService.HeartBeat:connect(function() workspace.CIWS:SetPrimaryPartCFrame(CIWS:GetPrimaryPartCFrame().p, Camera.CFrame.lookVector) end)
But no, I get this: The gun moves a bit from it's start position and it doesn't rotate.
Did i miss something or 'am i doing this completely wrong?

1 comment
Lmao thanks but i made a mistake, you are aiming at the camera, not where the camera is pointing to, oh wait i should use mouse