# how to set camera's look-at point when moves along a curve?

I want to have my camera moves by "Follow Path", it moves pretty well except that its view angle is not what I want.

I want to have the camera's look-at point always to be the next point it moves to. How can I get this work with python script? (or is there a setting for that)

My guess is that if I set the rotation angle correctly at the beginning it will fulfill my requirement.

pi = 3.1415926
scene.camera.rotation_mode = 'XYZ'
scene.camera.rotation_euler[0] = rx*(pi/180.0)
scene.camera.rotation_euler[1] = ry*(pi/180.0)
scene.camera.rotation_euler[2] = rz*(pi/180.0)


where rx,ry,rz are the euler angle that I need to calculate at the beginning.

• if you are using the Follow Path constraint check "follow curve" option and set "forward" to Z and "UP" to Y – Chebhou Apr 22 '15 at 1:22
• are you doing the "follow path" using a script not a constraint ? – Chebhou Apr 23 '15 at 2:17
• @Chebhou yes. I used "follow path" in the script. How can I set constraint? Thanks! – diodeBucks Apr 24 '15 at 17:55

You can access and alter the properties of the constraints of an object, all constraints are listed in object.constraints, access each constraint by its name or type and of course the index

cam = scene.camera
# if you are sure the constraint exist and has the default name