Answered
0
0
void PlayBatRandom()
{
    EventInstance pEiMob = SoundSystem.GetEvent("event:/Monster_bat");
    int nRandom = Random.Range(0, 4);
    nSelect = nRandom*2;
    pEiMob.setTimelinePosition(nSelect);

    int nSelect = 0;
    pEiMob.getTimelinePosition(out nSelect);
    Debug.Log(nSelect);
    pEiMob.start();
}

////////////////////////////////////////////////////////////////////////////////////////////

I play sound with this code but only start play timeline = 0

how can I play another seconds?

  • You must to post comments
Best Answer
0
0

If you look at the documentation, setTimelinePosition() takes the desired position in milliseconds.

http://52.88.2.202/documentation/#content/generated/FMOD_Studio_EventInstance_SetTimelinePosition.html

The fix would be

pEiMob.setTimelinePosition(nSelect * 1000);
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.