Skip to content

Commit

Permalink
Use the right id to get the object 3D
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo committed Jun 2, 2023
1 parent cb81043 commit b85d5bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/systems/audio-system.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ export class AudioSystem {
swapAudioType(elOrEid);
audio = APP.audios.get(elOrEid);
if (isPositionalAudio(audio)) {
const obj = APP.world.eid2obj.get(elOrEid.eid);
const obj = APP.world.eid2obj.get(elOrEid.isEntity ? elOrEid.eid : elOrEid);
updatePannerNode(audio, obj);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/update-audio-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export function updateAudioSettings(elOrEid, audio) {
swapAudioType(elOrEid);
audio = APP.audios.get(elOrEid);
if (isPositionalAudio(audio)) {
const obj = APP.world.eid2obj.get(elOrEid.eid);
const obj = APP.world.eid2obj.get(elOrEid.isEntity ? elOrEid.eid : elOrEid);
updatePannerNode(audio, obj);
}
}
Expand Down

0 comments on commit b85d5bc

Please sign in to comment.