How to move/rotate joints using c#?

Right, I have an character for a FPS game (in this case I’ll have to use the entire body instead of the cutten arm), let’s suppose I have an aiming walk animation, but as almost all FPS it deals with mouselook, for improvement and realism, things such as arms, waist, and head has to rotate so the character can look to the direction I’m looking. But how can I do it on csharp? what are the lines and commands, and how am I going to do it without conflicts with the animation? and what is the process on the own engine?

Thanks for all the ones who help me…

Supposed you want your upper body to rotate around the x axis (up & down) so that it faces the point the camera is looking at.
First, you need a Vector3 variable which holds the point in world space that the upper body should be rotated towards. Do a raycast from the camera forward and use the hit.point as the lookat position. If the ray hits nothing (yu might be aiming into the sky), just use a spot which is in the camera’s forward direction, times 100 units or so (doesn’t really matter).

Now for the actual rotation. Let’s assume you upper body starts with a spine bone which has the pelvis bone as it’s parent and it’s child is another spine bone further going into the torso.
This spine bone is the bone we will rotate. All you need to do now is add a line in the LateUpdate() function (so the rotation is applied after the rotations fro any animations playing):

privateVector3 aimingTargetPos;
private Transform torsoPivotBone;

void LateUpdate() {
     torsoPivotBone.LookAt(aimingTargetPos);
}