Issue
Hi, I've remixed a template for networked aframe dynamic rooms using a form:
https://glitch.com/edit/#!/power-lily-pancake?path=public%2Fscene.html%3A41%3A0
For some reason whenever I add these lines of code to the <a-scene> tag, the entire project breaks:
networked-scene="
room: audio;
adapter: easyrtc;
audio: true;
video: true;
debug: true;
inspector=https://cdn.jsdelivr.net/gh/aframevr/aframe-inspector@master/dist/aframe-inspector.min.js"
I'm wondering if there is a way too add those lines of the code to the <a-scene> tag so it looks like this:
<a-scene dynamic-room networked-scene="
room: audio;
adapter: easyrtc;
audio: true;
video: true;
debug: true;
inspector=https://cdn.jsdelivr.net/gh/aframevr/aframe-inspector@master/dist/aframe-inspector.min.js"
>
But have it so the dynamic rooms are still working. Meaning if two people are in different rooms they will not see each other, but if they are in the same room they will be able to see each other. How can this be done?
Links
A-frame website: https://aframe.io
Networked A-frame documentation: https://www.npmjs.com/package/networked-aframe
Project containing my current code: https://glitch.com/edit/#!/power-lily-pancake?path=public%2Fscene.html%3A41%3A0
afaik the
dynamic-roomcomponent is designed to attach thenetworked-scene, not update it (since it doesn't handle updates). That's why the dynamic-room example scene does only have adynamic-roomcomponent, and also why thedynamic-roomis not working withnetworked-scene.I'd throw all the
networked-sceneattributes to thedynamic-roomsetup, but it's also possible to make the two work together pretty much like you want it:One way of solving this, would be using the
connectOnLoadproperty of thenetworked-scene- let thedynamic-roomchange the room, and then decide when to connect.Since
networked-scenechecks theconnectOnLoadin init - it will always use the default value. We need to make sure the default isfalseinstead oftrue.So two things need to be made:
change
networked-scenedefaults before the scene is initialized:emit
connectwhen the room id is set:Check it out in this glitch