GameMaker Studio 2: Audio Emitters and Listeners
Вставка
- Опубліковано 9 лют 2025
- Learn how to make objects play sounds at different volumes depending on where the player is - you can use this for things like waterfall sounds, evil gates that throb with malevolence, and cats.
[--- SUPPORT ME / SOCIAL MEDIA ---]
Discord: / discord
Patreon: / gamemakerrob
Itch: gamemaker-rob....
Twitter: / randomdude_sdu
======
Credits
======
Background animation by: AA VFX, Amitai Angor , / dvdangor2011
Music: www.bensound.co... edited by GameMaker Rob
Hello again GM Rob! This is exactly what I was looking for, cheers!
BS I'm glad you found it useful
THANK YOU VERY MUCH, YOU'RE A LIFESAVER!!!!
Thanks Rob!
Thanks Rob :) Great stuff.
You're welcome!
Thanks, could not get it to work for me and this is one of the most important things I needed to implement, used your tutorial to fix all of my issues.
Awesome! Thanks!
you're welcome!
A little confusing at first, but got the hang of it eventually! Thanks!
Yeah my technique still needs some work eh?
@@GameMakerRob Keep it at though man! Real potential here. This guide was really useful.
thanks alot!!!
you're welcome!
idk why, but the audio is inversed... when i got left the audio play left vice versa
For reasons I cannot figure out the audio from my emitter is not playing at all
i got a problem, when i change room, the emitters just stop working
This was a pretty clear tutorial!
Curious - what if I want a sound to play only as it passes right by the player? Like a bullet whizzing past the player as he is being shot at, making a crack sound as it breaks the sound barrier (in real life shooting). I don't want the sound to continuously play from afar, only when it reaches close to the player.
I would recommend just having the code check the distance between the objects before playing the sound.
Example:
if (distance_to_object(obj_Player) < sound_range *[name this whatever and make it be how close you want the object to be before playing the sound]* )
{
*[sound emitting code here]*
}
*[then you can make some code for it to stop playing after a certain distance]*
Hey is there any way to have the sound be based on distance but it always be heard at the same volume for both ears?
I don't actually know! I haven't used those functions for some time but check them out and the description should hopefully give you a clue.
audio_listener_orientation(1,1,1,1,1,1) worked for me
how do you make the sound of the object whenever you decide to make the object move randomly
try setting audio_emitter_position. It's not something I've used but it sounds like it should work - docs.yoyogames.com/source/dadiospice/002_reference/game%20assets/sounds/audio_emitter_position.html
🥇
You have controls on obj_player but moving the emitter...confusing?
What do you mean, sorry?
@@GameMakerRob nevermind! confused myself,and thought it's obj_emitter moving))... Great Tutorial!!
@@georgesaint5504 Thanks and np :) I wish I'd made a better demonstration as it IS hard to tell which square is moving, if that's what you're talking about :)