Time for action – animating a camera

Having added a new Track View sequence and director node, we need some objects to be added to this sequence for us to direct. In this example, we will animate a camera.

  1. First, navigate to the Misc section in the Rollup Bar, and click-and-drag a Camera entity into the level. This will create a wireframe preview of the camera showing its direction and Field Of View (FOV). You can move the camera object in your game world, as you would any other entity, using the Move and Rotate tools.
  2. Rename the newly created camera to cinematic_camera1. At this point, you should adjust your view to be able to quickly preview the view from the actual camera.

    Note

    For this example, we will only animate the camera movement from the camera's viewpoint and not from the perspective view.

  3. To change your active view to cinematic_camera1, right-click on the top bar in the viewport.
    Time for action – animating a camera
  4. Reopen the dialog and also deactivate Lock Camera Movement. This will allow us to control the movement of the camera from its own perspective.
  5. Back in the Track View editor, let's now add this camera to the sequence.
  6. To add any entity to a Track View sequence, simply select the entity in the editor, in our case the cinematic_camera1 entity, and then add it to the Track View sequence using the Add Selected Node icon.
    Time for action – animating a camera

    You will notice that when the camera is added to the sequence, it already has some default tracks attached.

    Note

    A camera node can have only the default tracks of FOV, Position, and Rotation, plus an events track, but animated objects and characters can have many more.

  7. Having unlocked the camera movement, we must now click on the Record icon in Track View to automatically key frame any movement changes to an object in the editor.
  8. Select the camera in the editor; you can do this quickly by double-clicking on the entity in Track View.
  9. Click Record and move the camera to its initial starting position.

    You can move the camera in the exact same way that you navigate the viewport in Sandbox. It does, however, allow us to do interesting motions, such as banking and rotating the camera.

  10. Navigate the camera to a good starting position, where you'd like the flythrough of the environment to begin.
    Time for action – animating a camera

    Note that the key frames are added for Position and Rotation automatically, while the Record icon is active.

    Note

    You can also animate FOV, which is helpful for zooming in on an object quickly.

  11. Next, move the active time slider to 10 seconds.
  12. Keeping in mind that the animation will be interpolated between two key frames, make another key frame at 10 seconds by moving the camera to a different position.

    At this new position, let's add some roll to the camera.

  13. With the camera selected, click on the rotate tool, and then in the type-in dialogs at the bottom of the viewport, type in a value in the Y parameter.
  14. The higher the value, the more the camera will roll. Use negative values to roll in the opposite direction, as shown in the following screenshot:
    Time for action – animating a camera
  15. Another effective way of adding variations to the movement is by using the Curve Editor. The Curve Editor can be accessed through the View section of the Track View editor.
  16. Change the view to the Curve Editor, and select-and-drag one of the axis key frames to a different location at frame 10. Note that since the key frames are stored in seperate XYZ channels, you can edit them independently. You may also notice the Bezier modifiers on each key frame. This will allow tangents to be adjusted between the key frames, as shown in the following screenshot:
    Time for action – animating a camera
  17. Change the view back to the Dope Sheet and scrub the time slider from frame 10 to frame 0 and back. Notice that you are instantly able to preview the animation!
  18. Drag the time slider to 20 seconds, and create a new position for the camera in a forward direction from the last key frame. For this example, this will be the final key frame for the camera.

    Because we are animating a flythrough, you can of course create as many key frames as you like by dragging the time slider forward and moving the camera to a new position for as long as you want your sequence to last.

    For this example, our sequence is only three key frames long.

  19. You can now preview the entire sequence by clicking on the Play icon.

    Having created key frames at 0, 10, and 20 seconds, you may find that the camera movement is either too fast or too slow. There are two ways to adjust this. The first way is the most accurate, which is to select all the key frames at a particular time and bring the time between key frames down by dragging them closer. Alternatively, drag them further apart for longer sequences.

  20. To return to the default camera view, in the same dialog used earlier to unlock the camera's movement, click on the Default Camera entry.

    Make sure to save this sequence as we will re-use it later on in this chapter.

  21. Save the .cry file as Forest_sequences.cry.

What just happened?

The sequence that we have just created can be triggered via different means during game mode for a variety of purposes. A simple flythrough can be used to introduce areas, give the player a unique view of events, and to further the story and narrative. Commonly, it is also used to create gameplay-specific events to occur, such as the movement of certain entities within the game world and so forth.

Have a go hero – doing more with the tools available

We explored some tools in the previous example, which are used to create cutscenes. We did not, however, explore all of them. Let's try to use a few of the different settings available to us.

FOV

The FOV on a camera can be set and animated by changing the value on the Camera entity, which will be key-framed while the record is active. Alternatively, you can type in the values to a manually created key frame by double-clicking anywhere on the FOV track. Some good FOV values for cutscenes are usually between 35 and 45, depending on the required shot.

Playback speed

You can adjust the play speed of the Track View editor by clicking on the pull down icon beside the Play button.

Options available will not translate to in-game triggering of this sequence, and will only be used for previewing in the editor.

Curve Editor

Animators will likely be familiar with a Curve Editor approach to key framing objects within Track View. You can adjust your view to contain both the Curve Editor and the Dope Sheet by selecting both of them from the View menu.

There are many Curve Editor tools, most of which are pertaining to the editing of the tangents between key frames.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.254.122