# i´cant update the 3d panner

**URL:** <https://qa.fmod.com/t/i-cant-update-the-3d-panner/12594>\
**Category:** Unity\
**Created:** [July 14, 2016, 6:00am UTC](https://qa.fmod.com/t/i-cant-update-the-3d-panner/12594 "2016-07-14T06:00:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hackeas](https://avatars.discourse-cdn.com/v4/letter/h/ac91a4/32.png) [@hackeas](https://qa.fmod.com/u/hackeas)\
**Post date:** [July 14, 2016, 6:00am UTC](https://qa.fmod.com/t/i-cant-update-the-3d-panner/12594/1 "2016-07-14T06:00:02Z")

</div>

I have an enemy moving towards the player but the audio is repeated many times, that line of code missing?

![enter image description here](https://s32.postimg.org/xvbw9ot2t/image.png)

using UnityEngine;  
using System.Collections;

public class EnemyMovement : MonoBehaviour  
{  
Transform player;  
PlayerHealth playerHealth;  
EnemyHealth enemyHealth;  
NavMeshAgent nav;

```
[FMODUnity.EventRef]
string Playerstate2 = "event:/Music";

void Awake ()
{
    player = GameObject.FindGameObjectWithTag ("Player").transform;
    playerHealth = player.GetComponent <PlayerHealth> ();
    enemyHealth = GetComponent <EnemyHealth> ();
    nav = GetComponent <NavMeshAgent> ();

}

void Update ()
{
	//FMODUnity.RuntimeManager.PlayOneShot (Playerstate2, transform.position);
	//FMODUnity.RuntimeManager.PlayOneShot(Playerstate2, GameObject); 
	Playerstate2.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(gameObject,cachedRigidBody));
    if(enemyHealth.currentHealth > 0 && playerHealth.currentHealth > 0)
    {
		
        nav.SetDestination (player.position);

    }
    else
    {
        nav.enabled = false;
    }

}

```

}

---

<div class="post-metadata">

**Author:** ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)\
**Post date:** [July 18, 2016, 2:07am UTC](https://qa.fmod.com/t/i-cant-update-the-3d-panner/12594/2 "2016-07-18T02:07:46Z")

</div>

If the sound is constantly repeating then you either need to look at the event in FMOD Studio, or you are constantly restarting the event in code. You haven’t shown the code that would let us determine if it’s the second case.
