hit2501 Posted December 19, 2015 Share Posted December 19, 2015 Hi Babylonians! Anybody knows how can I detect when the camera is moving so I can play a .wav of footsteps? I use this snippet to play audio:var pasos = new BABYLON.Sound("Pasos", "audios/pasos.wav", scene, null, { loop: true, autoplay: false, volume: 5 }); and works fine but I want play it only when camera is moving. Just in case, I´m using a FreeCamera (w,a,s,d). Thanks and regards. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted December 19, 2015 Share Posted December 19, 2015 Hi H! Good to see you. Why do you say you want the sound "when the camera is moving"? What if you said you wanted sound "when the keys are pressed or held"? Same thing, yes? And playing sounds with keypresses... "sounds" easy to me. *shrug* Correct me as needed. NasimiAsl 1 Quote Link to comment Share on other sites More sharing options...
Temechon Posted December 19, 2015 Share Posted December 19, 2015 Hello, It might be helpful : https://github.com/Temechon/Dungeon/blob/master/Dungeon.js#L152 NasimiAsl and davrous 2 Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted December 19, 2015 Share Posted December 19, 2015 That's clever Temechon! I like the idea of using random step sounds to give realism. Quote Link to comment Share on other sites More sharing options...
hit2501 Posted December 20, 2015 Author Share Posted December 20, 2015 That´s right Wingnut. Thanks Temechon, it worked for me. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.