After getting some animations done in Blender, I have come back to an issue I’ve been stuck on with Blender since last year – getting the upper chest of my character to rotate with the FPS camera.
I’ve been avoiding the usual IK and converting character to ‘humanoid’ (she is set to ‘generic’ rig), and I found a slightly hacky approach after searching on internet (including these forums) by putting this into my ‘mouse look’ script:
void CameraMove()
{
Vector2 Mouse = new Vector2(Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y"));
cameraY -= Mouse.y * cameraSpeed;
cameraY = Mathf.Clamp (cameraY, minAng, maxAng);
pCamera.localEulerAngles = Vector3.right * cameraY;
player.Rotate(Vector3.up * Mouse.x);
// I know I should probably be using humanoid IK, but it works
// Provided there are rotation constraints, of course
bone.Rotate(Vector3.left * Mouse.y);
}
Unfortunately, I now have the issue of the arm and camera not exactly being in sync, causing the arm to move towards or away from the FPS camera when looking in vertical axis:
recklesslikablebabirusa
My hierarchy is set to where the camera has it’s own bone, and the chest is rotated by using an empty object (the “rotate” featured here). Both have rotation constraints, with chest being constrained to empty object and empty constrained to follow the rotation of camera
I’ve heard that this can be caused by the cameras and the character model/arms not being uniform scale or position… but no matter how I position the camera objects, the arms always look “off”.
I don’t want to resort to separating and parenting the arms to the camera (like most FPS), but not sure what to do at this point.
Ideally, I’d like to have the gun positioned like they do in Goldeneye/Perfect Dark:
Anyone have an idea what I could be doing wrong?