Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
If your are like me and didn't find a way to adjust music volume versus sound effects then here is you answer: Attach two 3D sound nodes to your player - name one 'music' and the other 'soundFx' You can now dynamically change the volume of either the music or sound effects in game using javascript: This is not even mentioned in the CopperCube list of available selections in game - yet still works: var s = ccbGetSceneNodeFromName("music"); // a 3D sound node attached to Player as a 2D sound var snd = "attack1"; // whatever the sound file name is you want to change to at any time var sound = "sounds/"+snd+".ogg" // fixed location of sounds in game directly under CopperCube directory ccbSetSceneNodeProperty(s, "SoundFileName", sound); ccbSetSceneNodeProperty(s, "Volume",vol); |
||||
|
Very nice. Good code fragment to keep for CC. Thank you. |
|