Skip to content

💻 Track To constraint

  1. Load track_to.blend

This scene contains two moving cubes and a single camera.

We would like to keep the camera pointed at one of the cubes as it moves across the scene. We could animate the camera orientation ourselves, but there is an easier way using a constraint. A constraint operates on an object and can influence things like orientation or scale amount based on another object's properties.

We will be using a Track To constraint here, which keeps one object pointing at another object.

  1. Select the camera
  2. Switch the Properties panel to the Object Constraints tab using the icon
  3. In the Add Object Constraint menu pick Track To under Tracking

The Track To constraint will keep the object, in this case our camera, oriented at another object all the time. The other object is called the Target object (in this case one of the cubes).

  1. In the constraint settings under Target (the top one!) pick Cube

If you had the 3D View set to view through the active camera (the view will be named Camera Perspective) one of the cubes should now be nicely centered in the view.

  1. Check that when playing the animation the cube indeed stays centered in the camera view.
  2. Orient the 3D view so you can see the camera's orientation in relation to the scene, specifically the targeted cube.

There is a blue dotted line indicating the constraint between the camera and the cube. To understand how the Track To constraint works in this case we need to understand the basic orientation of a Blender camera.

  1. Add a new Camera (Shift-A > Camera)
  2. Select it and clear its rotation with Alt-R.
  3. Zoom in on the new camera so you can see along which axis it is looking. Also note which axis is the Up direction of the camera (i.e. pointing towards the top of the view as seen by this camera).
  4. Select the original camera we wanted to animate and which has the Track To constraint.
  5. Change the 3D view so you can see the whole scene, including the selected camera. Change the Track Axis value of the Track To constraint to different values. Also experiment with different values for the Up setting. Compare these settings against what you concluded from step 10.

Last update: 20 March 2024 10:18:57