0
0

Hello, So currently I am adding in voice lines into my game and I’m running into an issue that when the voice line starts it gets the listeners original position in 3d and starts the voice line, but during the sentence, the voice line does not update while he is talking. now I’m using coroutines in unity and I’m quite new to fmod. so any help you have for me would be greatly appreciated!

IEnumerator LateStart(float waitTime, string voicepath)
{
    float Timer = 0;
    Timer = Time.fixedDeltaTime;
    RobotVoice = FMODUnity.RuntimeManager.CreateInstance(voicepath);
   RobotVoice.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(Robot.position));
    RobotVoice.start();

    while (Timer < waitTime)
    { 


        FMODUnity.RuntimeManager.SetListenerLocation(player);
        yield return 0;
    }
    RobotVoice.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
    RobotVoice.release();
    Timer = 0;

   }
  • You must to post comments
0
0

Hi Keil,

Could you post some more context around your code? I’m not quite clear on what you’re trying to achieve based on your description. Your co-routine is only updating the listening position with the player, maybe it needs to be calling RobotVoice.set3DAttributes every frame?

Thanks,
Richard

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.