Skip to content

Commit

Permalink
Merge pull request #2985 from t3du/fixsound
Browse files Browse the repository at this point in the history
Play sound node: fix sound load and retrigger
  • Loading branch information
luboslenco committed Dec 25, 2023
2 parents 6c09dbb + 860e67c commit 4575764
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/armory/logicnode/PlaySoundRawNode.hx
Expand Up @@ -27,7 +27,7 @@ class PlaySoundRawNode extends LogicNode {
override function run(from: Int) {
switch (from) {
case Play:
if (sound == null) {
if (property6 == 'Sound' ? sound == null : true) {
iron.data.Data.getSound(property6 == 'Sound' ? property0 : inputs[5].get(), function(s: kha.Sound) {
this.sound = s;
});
Expand All @@ -36,6 +36,8 @@ class PlaySoundRawNode extends LogicNode {
// Resume
if (channel != null) {
if (property2) channel.stop();
if (property6 == 'Sound Name')
channel = iron.system.Audio.play(sound, property1, property5);
channel.play();
channel.volume = inputs[4].get();
}
Expand Down

0 comments on commit 4575764

Please sign in to comment.