I am trying to make a third person shooting game, but I've run into an issue. When the torso is facing forward, everything seems to work just fine. But when the torso is rotated, the head and arms rotate in the y axis relative to the torso, when I want them to always point to the camera. Here is the code that makes the head point in the right direction:
Neck.C0 = CFNew(0, YOffset, 0) * CFAng(3 * math.pi/2, 0, math.pi) * CFAng(-asin(CameraDirection.y), 0, 0)
Does anyone know how to fix this, or is this just something I'll have to live with?