How can I make C0 rotation be straight?

Hard to explain in the title, but heres what I mean.

I began working on a SWAT game today and need to make the characters look up and down with your camera. That part is easy enough, but when I do it, the torso would rotate on an angle which causes whatever gun you may be holding to start aiming to the side, as seen in the video below:

Is there any good way to avoid this while still using C0/C1? Thanks for assisting.
Any clarification will be made if needed

1 Like

One idea is that you can add another CFrame to change the rotation axis.

Hope this example below gives you an idea, otherwise you should provide some code:

Thanks, but unfortunately this doesn’t really help me much. I’ve never been that great with CFrame so that’s mainly why.

Here’s the code if that helps:

This is what makes the body parts rotate
image

These are the functions in the above image
image

“LookAngle” is in radians

1 Like

After playing around with the math a little, I figured out a good enough solution. It’s not perfect but it keeps the gun relatively straight.
image

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.