# Weapon swish logic. Need help

**URL:** <https://qa.fmod.com/t/weapon-swish-logic-need-help/20541>\
**Category:** FMOD Studio\
**Created:** [August 14, 2023, 1:52pm UTC](https://qa.fmod.com/t/weapon-swish-logic-need-help/20541 "2023-08-14T13:52:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![trjaudio](https://avatars.discourse-cdn.com/v4/letter/t/ea666f/32.png) [@trjaudio](https://qa.fmod.com/u/trjaudio)\
**Post date:** [August 14, 2023, 1:52pm UTC](https://qa.fmod.com/t/weapon-swish-logic-need-help/20541/1 "2023-08-14T13:52:01Z")

</div>

Hi. I have a problem with some simple functionality.

VR project.

I have a sword. When I move the sword fast, I want a fast “swish” sound to play only  
When I move it slow, I want a slow “swish” sound to play only.

I have made an event. Set it to persistent. Made 2 multi instruments. One fast swish and one slow swish  
I get the parameter “speed” of the sound emitter (built in in fmod).  
I then set the instruments up on the “speed” parameter.  
When I test the game, I get 2 distinct swishes, but if I go fast, I get the fast swish sound, but afterwards I always get the slow swish sound as well. The reason is that I always end up with a slow speed (because I am stopping the swish movement/speed with my controllers).

How would I solve this, so if I have the fast swish sound playing, I wont hear the slow swish sound?  
I want to make this a higher resolution solution (with not only fast/slow, but more values in between).

Thanks!

Maybe @Alcibiade amazing brain can help me out? 🙂

---

<div class="post-metadata">

**Author:** ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)\
**Post date:** [August 16, 2023, 6:13am UTC](https://qa.fmod.com/t/weapon-swish-logic-need-help/20541/2 "2023-08-16T06:13:04Z")

</div>

I’m afraid there is no easy way to implement the behavior you describe purely in FMOD Studio. There is simply no perfectly-reliable way to use a speed built-in parameter to both detect when to play a sound _and_ to use a speed built-in parameter to decide which asset to play, while ensuring that the asset associated with the fastest speed in a given acceleration-and-deceleration period takes priority, when you are not able to predict or control the event instance’s rate of acceleration and deceleration.

You are going to have to write code that checks or predicts the highest in-game speed of the sword’s movement each swing and determines which event to play based on that information, or something similar.

---

<div class="post-metadata">

**Author:** ![trjaudio](https://avatars.discourse-cdn.com/v4/letter/t/ea666f/32.png) [@trjaudio](https://qa.fmod.com/u/trjaudio)\
**Post date:** [August 16, 2023, 6:47am UTC](https://qa.fmod.com/t/weapon-swish-logic-need-help/20541/3 "2023-08-16T06:47:02Z")

</div>

Ok. Thanks 🙂

---

<div class="post-metadata">

**Author:** ![vojtanedved1](https://avatars.discourse-cdn.com/v4/letter/v/8c91f0/32.png) [@vojtanedved1](https://qa.fmod.com/u/vojtanedved1)\
**Post date:** [August 22, 2023, 7:11am UTC](https://qa.fmod.com/t/weapon-swish-logic-need-help/20541/4 "2023-08-22T07:11:56Z")

</div>

Try this: Go to speed parameter setings and check “hold value”. It will only play sword sound with initial value set.

---

<div class="post-metadata">

**Author:** ![trjaudio](https://avatars.discourse-cdn.com/v4/letter/t/ea666f/32.png) [@trjaudio](https://qa.fmod.com/u/trjaudio)\
**Post date:** [August 22, 2023, 7:25am UTC](https://qa.fmod.com/t/weapon-swish-logic-need-help/20541/5 "2023-08-22T07:25:22Z")

</div>

Didn’t even know about the “Hold” feature. Thanks for pointing it out.

---

<div class="post-metadata">

**Author:** ![vojtanedved1](https://avatars.discourse-cdn.com/v4/letter/v/8c91f0/32.png) [@vojtanedved1](https://qa.fmod.com/u/vojtanedved1)\
**Post date:** [August 22, 2023, 8:00am UTC](https://qa.fmod.com/t/weapon-swish-logic-need-help/20541/6 "2023-08-22T08:00:49Z")

</div>

You’re welcome. From sound designer point of view you can also try pitch automatization on your instruments.
