For example, surround sound in cinema almost universally uses rear and side speakers for ambient fill effects, and almost never for significant auditory cues, because to do so would distract the audience from the action on the screen in front of them.Ī head-mounted display changes everything.
With the exception of some FPS games where 3D audio provides a tactical assist that players learn to use to their advantage, too much realism in audio for a flat screen game or movie can sometimes be a distraction, especially if it is inconsistent with the visual experience. With a 2D screen in front of you, if you hear a sound of a voice or an object behind you and turn toward it, all you will see is perhaps a speaker or the walls of your apartment. Although hearing is inherently a 3-dimensional sense, audio for flat screen games and cinema/video has usually minimized the use of 3D and other advanced audio rendering technologies, for the simple reason that all of the graphics and video is in front of you. In the many years of history of games and video on flat screens, the standard of realism for audio rendering has remained relatively low, especially when compared against contemporaneous advances in graphics and cinematic video rendering. Virtual reality demands a new way of thinking about audio processing. There’s also an issue with the first crouch, but in principle this gives us a smooth up/down transition.Audio Must be Consistent With What You See While this works, it means that some of the other values (like crouched walk speed) are not set. Timeline and Lerp Node is a killer combination! This continuously updating value sets our half height. It’s output is wired to the Alpha Input of the Lerp Node, which does the actual value interpolation (between 44 and 80 in our case). Here’s how this works: Our Timeline gives out a value between 0 and 1 over the course of a short duration (0.3 seconds in my case). The solution is to animate the capsule component’s half height, as (presumably) the crouch/uncrouch function does. We can make this look a little neater by animating the crouch height value using a Timeline and a Lerp Node. Notice how the crouch height just switches between regular and low. With all of this in place, our character will now crouch when we hit the C key. The Flip Flop will remember its previous state, so we can wire the Is A output up to the Is Crouched input of the Toggle Crouch. We’ll get the controlled pawn as target input and reference. I’ll use a Flip Flop node to detect the key press and hook up both white wires to the Toogle Crouch call on our Player Character (if this doesn’t show, complete the previous step first and compile). I’m using the C key, but anything will work (that’s done under Edit – Project Settings – Input). I’ll call mine Crouch and wire it up so that it makes the interface call. We need to setup an input so the player can initiate the crouch. Next we’ll jump into the Player Controller. These values will become more important when we setup the smooth crouch later. Our default capsule half height is 88, so crouching will set this to 40 (or whatever value we set here), while un crouching will set this back to 88. Here’s where the default is set (with Character Movement selected in the viewport): In other words, when we crouch, the collision capsule around our character will become smaller.
The crouch/uncrouch function will set our character’s capsule component’s crouched half height (yes… quite a mouthful). Let’s wire them up via a Branch Node, checking the incoming Is Crouched boolean (we’ll set this in the next step). It has two functions we can call: Crouch and Un Crouch. The crouch-ability is part of the Character Movement component, which in turn is part of the Character object. Let’s add the interface we’re using to our Player Character. We need a boolean input called isCrouched as well to communicate an already crouched state. Our interface only needs a single function. a Player Character (I’m using a First Person character).We’ll need the following items for this to work:
I’ll explain how to implement the whole process using an interface call, and I’ll show how we can make the transition from standing to crouched smooth rather than jumpy. All credit for this goes to Mathew Wadstein and his excellent video tutorial. It’s a little complicated so I thought I’d take some notes in the intricacies. I’ve just learnt how to let a player character crouch.