Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make character look up and down regardless of Torso's rotation?

Asked by 3 years ago

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?

0
You're going to need to counter the torso's rotation too with how you've got this set up because those are local rotations iirc. SteamG00B 1633 — 3y

Answer this question