# Car Engine Sound stays steady, dynamic adaption to trigger input does not work

**URL:** <https://qa.fmod.com/t/car-engine-sound-stays-steady-dynamic-adaption-to-trigger-input-does-not-work/17085>\
**Category:** Unity\
**Created:** [April 21, 2021, 5:58pm UTC](https://qa.fmod.com/t/car-engine-sound-stays-steady-dynamic-adaption-to-trigger-input-does-not-work/17085 "2021-04-21T17:58:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jns\_myr](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@jns\_myr](https://qa.fmod.com/u/jns_myr)\
**Post date:** [April 21, 2021, 5:58pm UTC](https://qa.fmod.com/t/car-engine-sound-stays-steady-dynamic-adaption-to-trigger-input-does-not-work/17085/1 "2021-04-21T17:58:51Z")

</div>

Hello everybody,  
my problem occured at starting up a car engine sound for my unity project.

If I press “play”, my RPM and my AccelInput value stay on their initial value, I gave them before starting, but the two values should adapt dynamically to my trigger input.  
I can see the car moving, so there is an controller input to the project, but it does not change the value for RPM or AccelInput.

I think maybe the update does not work properly, but i could not find a way to fix it.

That is the relevent part of my script, would be great if someone could help me out, thanks already!

```
 void Start ()
 {
 cachedRigidBody = GetComponent<Rigidbody>();	       
 FMODUnity.RuntimeManager.AttachInstanceToGameObject(CarEngine, GetComponent<Transform>(), GetComponent<Rigidbody>());
     CarEngine.start ();
 }

 void Update ()
 {
  	CarEngine.setParameterByID(RPMParameterId, (float)CC.CurrentSpeed);
CarEngine.setParameterByID(AccelInputParameterId, (float)CC.AccelInput);
 }
```

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [April 26, 2021, 1:22am UTC](https://qa.fmod.com/t/car-engine-sound-stays-steady-dynamic-adaption-to-trigger-input-does-not-work/17085/2 "2021-04-26T01:22:37Z")

</div>

Are you able to use `Debug.Log()` to see if the values of `CC.CurrentSpeed` and `CC.AccelInput` are changing as expecting?

---

<div class="post-metadata">

**Author:** ![jns\_myr](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@jns\_myr](https://qa.fmod.com/u/jns_myr)\
**Post date:** [April 30, 2021, 3:42pm UTC](https://qa.fmod.com/t/car-engine-sound-stays-steady-dynamic-adaption-to-trigger-input-does-not-work/17085/3 "2021-04-30T15:42:14Z")

</div>

Just typing in Debug.Log() into my code does not get me any new errors, but also does not change anything for me.  
If you maybe could explain to me what that command should do if it works, would be great.

Thanks already!

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [May 5, 2021, 12:51am UTC](https://qa.fmod.com/t/car-engine-sound-stays-steady-dynamic-adaption-to-trigger-input-does-not-work/17085/4 "2021-05-05T00:51:50Z")

</div>

This is kind of starting to get more into Unity support than FMOD, but `Debug.Log()` is used to print messages to the console. What you need to do is, inside your `Update()` function print the values of `CC.CurrentSpeed` and `CC.AccelInput` to make sure they are giving you the values you are expecting.

```auto
void Update ()
{
    Debug.Log("Current speed: " + CC.CurrentSpeed);
    Debug.Log("Accel Input: " + CC.AccelInput);
    CarEngine.setParameterByID(RPMParameterId, (float)CC.CurrentSpeed);
    CarEngine.setParameterByID(AccelInputParameterId, (float)CC.AccelInput);
}

```
