# BP\_MovementSoundComponent

This page describes the Movement Sound Component that ships with Motion. The Movement Sound Component handles input events caused by Animation Notifiers by finding and calling the correct MetaSound source.

### Dependencies

* requires BP\_SprintingComponent.
* requires BP\_CrouchingComponent.

### Methods

#### Getters

| Name                        | Description                                                                                                                               |
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| GetCurrentFloorSurface      | Returns the current floor's surface type. Returns "Default" is none is set.                                                               |
| GetMetasound                | Finds sounds with the given sound type and surface type from the sound data table. Prints warning messages if a sound could not be found. |
| GetSoundTypeForMovementMode | Returns the proper EMovementSoundType given if the player has jumped or not.                                                              |
| GetSoundTypeForSide         | Returns the proper EMovementSoundType given the step side and sprint state.                                                               |
| GetSoundVolume              | Returns the volume for a sound. If bUseSpeedForVolumeAdjust is true, it will adjust the volume according to the player's speed.           |

#### Event Handler

| Name                        | Description                                                                                                                                                                                                    |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| HandleEventOnBeginPlay      | Called when "Event Begin Play" gets called. Sets up events and saves component references.                                                                                                                     |
| HandleFootsteps             | Handles footsteps & footstep timer. Checks if the player should trigger another sound to be played, if they are fast enough to play a sound and the selection of a sound with volume adjustment for crouching. |
| HandleJumpLandSounds        | Handles landing sounds. Detects the floor beneath the player, its surface and then chooses a sound fit for that surface.                                                                                       |
| HandleOnMovementModeChanged | Called when the movement mode changes (e.g. from falling to walking)                                                                                                                                           |

***

### Variables

#### Configuration

| Name                         | Description                                                                                                                                                                            |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| bShowDebugInformation        | If true, various useful variables will be printed on the screen to help with debugging                                                                                                 |
| bUseSpeedForVolumeAdjustment | If true, the players speed will be used to reduce the volume of footsteps. Useful if you want steps to be more quiet if the player is only slighty tipping their controllers joystick. |
| bIsEnabled                   | If false, the component will only print debug data and not update any other values.                                                                                                    |

#### Default

| Name               | Description                           |
| ------------------ | ------------------------------------- |
| SprintingComponent | Reference to the sprinting component. |
| CrouchingComponent | Reference to the crouching component. |

#### Component Data

| Name         | Description                        |
| ------------ | ---------------------------------- |
| CurrentSound | The current movement sound played. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://motion.docs.regensturm.com/components/bp_movementsoundcomponent.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
