Associating sounds with character moves in Matinee

An action appears more lively if a sound goes with it. When you are playing a character animation from Matinee, there is no player input to cue the animated SkeletalMesh as to what sound to play, so whenever a sound is needed we'll have to provide a cue through a sound track or event track on the timeline.

Getting ready

Load the scene Packt_03_SoundTrack_Start.UDK. This map continues from the end of the last recipe. Note the added particle emitter attached in its Attachment property to the b_LeftHand of the SkeletalMesh Packt_SkinTail.

How to do it...

Associating sounds with animation using Matinee sound tracks and event tracks

  1. Quite often, to open a Matinee, users will open Kismet and then open the Matinee that they want to edit from there. There's another way to get there. Click the Open UnrealMatinee icon [ How to do it... ] next to the Kismet icon in the editor. What this does is expose any single Matinee in the scene (which is the case here) or offer a list of Matinee actions to choose from. It's good to add Obj Comment names to your Matinee actions because the names show up on the ends of the list entries.
  2. Having pressed the icon [ How to do it... ] you'll get the warning shown next. Avoid this by selecting the SkeletalMeshMAT actor in the scene, pressing F4, then changing the Movement | Physics property to PHYS_Interpolating.
    How to do it...
  3. The Matinee Editor will open whether or not you fix the issue. There, right-click under AnimTrack and choose Add New Director Group. Highlight the DirGroup track and right-click and choose Add New Sound Track.
  4. Highlight the cue PacktWavs.Cue.Impact_Cue in the Content Browser.
  5. Move the time slider along to where the graphs for the two moves cross, and add a key to the Sound Track. Impact_Cue should appear on the timeline. A colored bar represents its active duration. Adjust the onset time of the key by right-clicking at the start of the sound cue on the timeline and choosing Set Time. Alternatively you can also hold Ctrl and drag on the key to move the cue.
    How to do it...
  6. By right-clicking the key of the Impact_Cue you can set the Sound Volume, set the Sound Pitch, or locate the asset in the Content Browser, which is handy in a large scene.
  7. PIE and check whether the sound plays at the right time.
  8. That is one way to add sound. Another is to add an event track by right-clicking the DirGroup track and choosing New Event Track. When you key an Event track you can add a named key, as shown here:
    How to do it...
  9. The keys will appear as connectors on the Matinee action in Kismet, and you can hold S and click to add a Play Sound to hook up to each one. For its Play Sound property, select a SoundCue in the content browser then click assign [ How to do it... ].
  10. Using Event tracks instead of Sound tracks lets you add things other than sound such as particle effect toggles. Load the file Packt_03_SoundTrackDEMO.UDK and PIE to see a result based on both approaches.

How it works...

The previous step states you can make an Event track control a sound. The Event track keys are set on the timeline in Matinee Editor and then feed out of the Matinee into Kismet actions. You don't have to fire off sounds from an event; it allows you to hook up any action which you want to occur based on the Matinee timeline playing. In the next screenshot, besides sounds, we also have a particle emitter attached to the girl's hand. It is good to give visual and audio cues to events so the player is alerted to them.

How it works...
..................Content has been hidden....................

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