Answered
0
0

Hi,
I have doppler turned on (and set to 500% for testing purposes) in the relevant event macros in my FMOD Studio project but the effect is missing when I run my unity game. How do you enable the effect? I have found zero documentation on the topic and no answers in these forums.
Thanks – Brian

  • You must to post comments
Best Answer
-1
0

To use the doppler effect, you need to have a rigidbody on your event emitter. It uses the velocity of the rigidbody.

You are right, there doesn’t seem to be much documentation on it at the moment, we will look to rectify this. The only real info we have on it at the moment is here: http://www.fmod.org/docs/content/generated/FMOD_System_Set3DSettings.html

  • Cameron Baron

    I’m not having any issues getting it to work.
    These are the steps I took:

    – Create new Unity project and add FMOD integration.
    – Add cube to scene, remove 3D collider and add Rigidbody2D.
    – Move the cube high above the Main Camera (add Studio listener to camera).
    – Add emitter to cube and chose a sound.
    – In Studio make sure the event has doppler enabled, rebuild banks.
    – Hit play in Unity.
    – As the cube falls past the player you can hear the doppler.

    If that is working but not when you move your player(listener) it may be because the doppler relies on velocity from the rigidbody.

  • Brian Cullen

    Hi Cameron,
    Yep that works but unfortunately if you move an object via transform.Translate or you add an animation say a looping up or down animation to the exact same object the doppler effect completely fails to work. Unless you are using free falling objects with gravity, doppler is not working. I even have a cube in the project that drops from + 100 to -100 on the y axis that has a strong noticeable doppler effect when the animation is disable and allowed to free fall and no doppler effect whatsoever (or a very broken version) when animation is enabled (the animation is of equivalent speed and direction as the free falling scenario). In my game the cars use transform.Translate and doppler does not work there either. What next? Again they all have rigid bodies and correct studio settings etc.
    – Brian

  • Brian Cullen

    I will add that you can set gravity to 1 in the rigidbody while the up/down animation is playing and you get a glitchy/clicky broken versions of the doppler shift effect. I try all this with a standard non2D rigid body and all the same issues exist.

  • Cameron Baron

    By moving an object via the Transform, you are basically just telling the object it is in a new location now, not that it has traveled from one to another. Velocity is only used when applying forces to a rigidbody (eg. rigidbody2D.AddForce()). You can check this by printing the objects rigidbody2D.velocity to the debug console.

    As for animations, Unity have physics based animations on their roadmap (https://unity3d.com/unity/roadmap) but it is still under research.

  • Brian Cullen

    That makes sense – but I didn’t have this issue with fmod designer for the same game 3 years ago now. It might have been an idea to calculate the velocity based on transform/s positions over time irrespective of rigidbody calculations so that all movement types would work with Doppler as before – or I might be missing some logic here. I will look into a work around but would love to see a more inclusive solution in a future update so that fast moving objects using transform.translate or standard animations would work. Thanks for looking into all this for me – b

Showing 1 result
Your Answer

Please first to submit.