# I am having issues with the roll-a-ball tutorial. Specifcally the rolling sound.

**URL:** <https://qa.fmod.com/t/i-am-having-issues-with-the-roll-a-ball-tutorial-specifcally-the-rolling-sound/12722>\
**Category:** Unity\
**Created:** [September 30, 2016, 12:44am UTC](https://qa.fmod.com/t/i-am-having-issues-with-the-roll-a-ball-tutorial-specifcally-the-rolling-sound/12722 "2016-09-30T00:44:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![elijahlucian](https://avatars.discourse-cdn.com/v4/letter/e/7bcc69/32.png) [@elijahlucian](https://qa.fmod.com/u/elijahlucian)\
**Post date:** [September 30, 2016, 12:44am UTC](https://qa.fmod.com/t/i-am-having-issues-with-the-roll-a-ball-tutorial-specifcally-the-rolling-sound/12722/1 "2016-09-30T00:44:00Z")

</div>

the problem i run into is this line specifically.

```
rollingParam.setValue(Mathf.Max(Mathf.Abs(rb.velocity.x), Mathf.Abs(rb.velocity.z)) * 40.0f);

```

(my “rb” is the rigid body from the original unity project)

these are the errors I get.

NullReferenceException: Object reference not set to an instance of an object PlayerController.FixedUpdate () (at Assets/Scripts/PlayerController.cs:45)

FMOD Studio: Instance of Event event:/Movement found playing at the origin. EventInstance.set3DAttributes() should be called on all 3D events UnityEngine.Debug:LogWarningFormat(String, Object[])

So this leads me to believe that somehow the project supplied with the tutorials have something already set up, however I can’t see exactly where it is.

Another thing, that when I take out the line above my “movement” sound is triggered from the “ambience emitter” and not the player… seems really strange, seeing as how I am copying the code line for line and nothing was mentioned about how to set it up otherwise in the videos.

pls help!

---

<div class="post-metadata">

**Author:** ![elijahlucian](https://avatars.discourse-cdn.com/v4/letter/e/7bcc69/32.png) [@elijahlucian](https://qa.fmod.com/u/elijahlucian)\
**Post date:** [September 30, 2016, 3:13pm UTC](https://qa.fmod.com/t/i-am-having-issues-with-the-roll-a-ball-tutorial-specifcally-the-rolling-sound/12722/2 "2016-09-30T15:13:52Z")

</div>

> [@](#):
>
> the problem i run into is this line specifically.
> 
> ```
> rollingParam.setValue(Mathf.Max(Mathf.Abs(rb.velocity.x), Mathf.Abs(rb.velocity.z)) * 40.0f);
> 
> ```
> 
> (my “rb” is the rigid body from the original unity project)
> 
> these are the errors I get.
> 
> NullReferenceException: Object reference not set to an instance of an object PlayerController.FixedUpdate () (at Assets/Scripts/PlayerController.cs:45)
> 
> FMOD Studio: Instance of Event event:/Movement found playing at the origin. EventInstance.set3DAttributes() should be called on all 3D events UnityEngine.Debug:LogWarningFormat(String, Object)
> 
> So this leads me to believe that somehow the project supplied with the tutorials have something already set up, however I can’t see exactly where it is.
> 
> Another thing, that when I take out the line above my “movement” sound is triggered from the “ambience emitter” and not the player… seems really strange, seeing as how I am copying the code line for line and nothing was mentioned about how to set it up otherwise in the videos.
> 
> pls help!

here is my full code.  
[https://www.dropbox.com/s/7mm4wz2v2mewbci/PlayerController.cs?dl=0](https://www.dropbox.com/s/7mm4wz2v2mewbci/PlayerController.cs?dl=0)  
I tried some other code. still doesn’t work. still gives me the same error  
“Object reference not set to an instance of an object PlayerController.FixedUpdate () (at Assets/Scripts/PlayerController.cs:45)”

---

<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:** [October 3, 2016, 12:55am UTC](https://qa.fmod.com/t/i-am-having-issues-with-the-roll-a-ball-tutorial-specifcally-the-rolling-sound/12722/3 "2016-10-03T00:55:14Z")

</div>

Line 32 is not working correctly because the event “event:/Movement” doesn’t have a speed parameter.

Also to fix the warning about sounds playing at the wrong position you need a call set3DAttributes on the EventInstance in the fixedUpdate method.

---

<div class="post-metadata">

**Author:** ![elijahlucian](https://avatars.discourse-cdn.com/v4/letter/e/7bcc69/32.png) [@elijahlucian](https://qa.fmod.com/u/elijahlucian)\
**Post date:** [October 3, 2016, 11:32pm UTC](https://qa.fmod.com/t/i-am-having-issues-with-the-roll-a-ball-tutorial-specifcally-the-rolling-sound/12722/4 "2016-10-03T23:32:06Z")

</div>

> [@](#):
>
> Line 32 is not working correctly because the event “event:/Movement” doesn’t have a speed parameter.
> 
> Also to fix the warning about sounds playing at the wrong position you need a call set3DAttributes on the EventInstance in the fixedUpdate method.

I followed the series exactly… why does she mention to use “speed” here if it’s not something that exists… ?

---

<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:** [October 4, 2016, 5:31am UTC](https://qa.fmod.com/t/i-am-having-issues-with-the-roll-a-ball-tutorial-specifcally-the-rolling-sound/12722/5 "2016-10-04T05:31:14Z")

</div>

The videos don’t cover the creation of the events in studio. It’s assumed by the code that whatever event is being played has a parameter setup in studio called “speed”.
