Tag Info

New answers tagged


Each MediaPlayer can play only one audio at the same time (Remember, can you play multiple musics in your music player app?).But if you want to play multiple sounds you should use SoundPool instead. There you can play sounds with higher priority too. An example for SoundPool: link Check this for playing it in background: link


From a conceptual point of view you seem to be on the right track. Here is the way I did it. I'm currently developing a 3D game that I wanted to be able to run on low-memory Windows Phones. My game has lots of 20k tri models, so memory management was a problem. In essence, to solve my problem I broke my game down into about 4 sections: Global, menu, space, ...


I would not complicate things much: public bool IsUpright () { return transform.up.y > threshold;/*say 0.6 ?*/ } because the up vector is normalized and, naturally, points upwards you just need to check its length in Y axis(or the "up" axis if you use different one). It will be 1.0 when perfectly up and -1.0 if perfectly upside down. This ...


Adding to ZEKE answer. There are situations where changing a setting gives a temporary weird behaviour, and that is acceptable. In this case, really, it depends. Is your game based on the sound? Do you expect the player to use the mute/un-mute feature often? If the answer is yes to any of these, you'd probably want to play the sound, but set the volume ...


I'm not exactly sure what you mean by: his hero is getting shot, nothing will be played - even if it supposed to take 5 seconds and the option was changed after 2,5 seconds. If you only check for muted when you first play a sound, it will continue to play even after you pressed the mute button. The solution for this, is setting the volume of the ...


You can use the pan parameter on Sounds play method to balance a sound. -1 is full left, 1 is full right and 0 is center. // last parameter is pan and this will play the sound with a full left pan mySound.play(1f, 1f, -1); There is also a setPan method which you can use to update the pan of an already playing Sound.


We found a very easy solution to this problem. If you want to disable all the sounds from a specific AudioSource, use this in your stop audio function: public void StopSounds() { yourAudioSource.enabled = false; yourAudioSource.enabled = true; } (Run this function when you want to stop the sounds) This might be not the cleanest option but it ...

Top 50 recent answers are included