# How do to 3D panning on camera, attenuation on character

**URL:** <https://qa.fmod.com/t/how-do-to-3d-panning-on-camera-attenuation-on-character/21526>\
**Category:** FMOD Engine\
**Tags:** cpp, ue5\
**Created:** [April 22, 2024, 9:37pm UTC](https://qa.fmod.com/t/how-do-to-3d-panning-on-camera-attenuation-on-character/21526 "2024-04-22T21:37:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeremyabel](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@jeremyabel](https://qa.fmod.com/u/jeremyabel)\
**Post date:** [April 22, 2024, 9:37pm UTC](https://qa.fmod.com/t/how-do-to-3d-panning-on-camera-attenuation-on-character/21526/1 "2024-04-22T21:37:59Z")

</div>

I have the same question that was solved several years ago here: [Set up 3rd listener on 3rd person camera and attenuation on character](https://qa.fmod.com/t/set-up-3rd-listener-on-3rd-person-camera-and-attenuation-on-character/15163/1)

In terms of doing this in Unreal, is the approach the same? If I do this on tick, would that work, or would it conflict with FMODStudioModule::UpdateListeners() which seems to be bound to a tick function driven by UE’s media clock. Would I need to set up my tick function the same way in order for it to not cause issues?  
I could also just modify the FMOD plugin if needed

Thanks!

---

<div class="post-metadata">

**Author:** ![jeremyabel](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@jeremyabel](https://qa.fmod.com/u/jeremyabel)\
**Post date:** [April 23, 2024, 12:05am UTC](https://qa.fmod.com/t/how-do-to-3d-panning-on-camera-attenuation-on-character/21526/2 "2024-04-23T00:05:26Z")

</div>

Turns out it’s much simpler than that! Just need to override GetAudioListenerPosition in your player controller:

```auto
void AGNPlayerController::GetAudioListenerPosition(FVector& OutLocation, FVector& OutFrontDir, FVector& OutRightDir) const
{
	Super::GetAudioListenerPosition(OutLocation, OutFrontDir, OutRightDir);

	if (const APawn* CurrentPawn = GetPawn())
	{
		OutLocation = CurrentPawn->GetActorLocation();
	}
}

```

---

<div class="post-metadata">

**Author:** ![MarioMorellon](https://avatars.discourse-cdn.com/v4/letter/m/90db22/32.png) [@MarioMorellon](https://qa.fmod.com/u/MarioMorellon)\
**Post date:** [January 5, 2026, 5:25pm UTC](https://qa.fmod.com/t/how-do-to-3d-panning-on-camera-attenuation-on-character/21526/3 "2026-01-05T17:25:39Z")

</div>

This works awesomely good and I’m surprised that this post does not have dozens of answers and that no one thanked you yet, so here’s my gratitude.

To keep the love going and in case anyone else wants to do this and doesn’t know how to, like me an hour ago, here’s what I did for it to work.

You need to override Unreal’s built-in PlayerController.

In my case, the programmers already had a PlayerController class to override some of the functions, so I just needed to paste Jeremy’s piece of code into the .cpp of my game’s PlayerController, changing AGNPlayerController for the name of your class.

Then in the .h file you’ll need to add:

**`virtual`** ` ` **`void`** `GetAudioListenerPosition(FVector& OutLocation, FVector& OutFrontDir, FVector& OutRightDir)` **`const`** ` ` **`override`** `;`

And enjoy perfect panning and attenuation.

Thanks!
