How to parent a camera to an armature but locks the X and Y rotaion?

Hi every one !
first of all my knowledge about python = 0 OK :joy:
i’m looking for a PY script that copy an object/bone location and rotaion to another object
currently i’m working on a FPS game and i’m using an armature to move around , and when i parent the camera to the head bone it rotates with it and it looks really bad ( the idle animation contains a head roataion).

so i’m looking for a script or a way to do that , i hope i am understandable to you :blush:

watch this

use a bounding box to move, parent cam to etc.

1 Like

well , you solved another problem i have thank you ! . but that doesn’t solved all of my problem :confused:

have a look at this video below

as you can see the camera is always rotating with the head bone along the X , Y and Z axis so it would be better looking if you can block one or more axis

sorry about my english :neutral_face:

just use a bounding box. parent cam to it, problem solved, if you want head bobbing then just animate the camera and activate it when you walk, etc.

also camera axis are a bit different, y = local z axis

1 Like

thank you genius !