Skip to content

Hearing

The Hearing sensor represents the ability of a Perception component to hear noises above a certain threshold.

Settings

Perception Hearing Settings

The Use Obstruction field determines whether sound can be blocked by Obstruction components. Ticking this field will reveal a layer mask that determines which Obstruction components are considered as such.

Not using Obstructions

If your game is set in open spaces or you don't need noises to be blocked by nearby rooms you can untick the Use Obstruction field. Enabling this option comes with a slight performance overhead.

More information about these components can be found in the Obstruction page.

The Min Intensity and Max Intensity fields determine the range in which noises can be heard. Lower and higher noises will not be acknowledged by the Perception component.

Using intensities

It is known that dogs can hear higher pitched noises than human. You could model a situation where the player can use high intensity noises that only dogs can hear in order to distract them, without alerting other guards.

Decay Time is the amount of seconds a noise takes to fade out. Although noises are emitted as a one-shot effect, the hearing of a Perception components keeps hearing that noise due to the resonance inside a human's skull. This is more commonly known as Tinnitus effect in high-pitched noises.

Emitting a Noise

In order to emit a Noise the instruction Emit Noise can be used.

Perception Hearing Emit Noise

The Position field determines the origin of the noise emitted, while the Radius indicates how far it reaches.

The Intensity determines whether the noise stimulus can be heard by the Perception component or not. And the Tag is a custom value that can be used when building the AI to react differently depending on its value.

A whistle vs a gun shot

We could conclude that when an enemy hears a whistle it will change into a suspicious mode and approach the origin of the noise. However if it hears a gun shot it may turn into aware mode.

Reacting to Noises

The Perception component doesn't inherently increase its Awareness upon hearing a noise, unlike the sight sensor. This is because each noise tag can mean something different.

To react to noises a Trigger must be used with the On Hear event. Upon hearing any or a specific noise, the resulting reaction can be specified, like increasing the Awareness of the Perception component towards the player.

Trigger Hearing Noise

Din (Ambient Noise)

It is worth noting that noises can also be masked by the din or ambient noise. The din is a more advanced concept and it is covered in depth in the Din section.