Skip to content

Collision Sound Emitter

eisclimber edited this page Jan 18, 2024 · 1 revision

Collision Sound Emitter

class in ExPresSXR.Interaction / Extends MonoBehavior

Description

This Component plays a sound when a collision is detected on it's GameObject. Collisions tagged with 'Player' will be ignored. It can be used to play a sound when Interactables are dropped on the ground.

Note: The Component ignores any Collisions with objects that have the Player-Tag)

Members

Editor Properties

  • float _initialSilenceDuration = 0.5f: The duration after OnAwake() in seconds during which no sound is emitted. This can be used to prevent a sound being played at the start of the game while the physics still settles. Default Value: 0.5f.

Public Properties

  • AudioClip collisionSound: The sound played when a collision is detected.
  • AudioSource audioSource: The AudioSource used to play the provided 'dropSound'. If none is provided the current GameObject is searched for an AudioSource-Component.

ExPresS XR Wiki

Tutorial Pages

Code Documentation

Clone this wiki locally