Hello! I’ve been trying to look around for help and I’m struggling even trying to type this because my head has been hurting
Currently, I am working on a game that uses a “full body first person” system, similar to some games like DayZ, where instead of using a viewmodel for guns, and things like that. You see through the eyes of your character. Currently I am just getting the head cframe, applying some offsets to it, and it looks pretty good.
Right now though, I have been having an issue regarding trying to set up an ADS system, I definitely know how to implement it, but the problem is CFrame math jank, which I have no experience with whatsoever.
My code does some things when the camera updates, I clamp the pitch of the camera, and then change the C0’s of the motors to look down and up depending on the camera, which works for the arms
The GunModel is the model of the gun… duh. It has a ‘Grip’ Motor6D that is set from the RightLowerArm to the Handle of the gun, and the Motor6D is inside the RightLowerArm.
Right now, I am trying to figure out how to calculate the offset of the ‘CameraPoint’ attachment from the camera. The CameraPoint attachment is an attachment which is positioned to where I want my camera to be when I am aiming down sights, I want to move both arms to the center of the screen so that the CameraPoint attachment lines up with the camera. However I have been struggling with this. Since my arms and head update per render stepped, and you also have to take into account animations. Everytime I try to calculate it, it always ends up with both arms spinning out of control. I am using the ‘ArmsOffset’ cframe value inside my camera script to set the offset of both arms, as you could see in one of the previous screenshots. How would I go about accomplishing this? Thanks!