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-room
component 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-room
component, and also why thedynamic-room
is not working withnetworked-scene
.I'd throw all the
networked-scene
attributes to thedynamic-room
setup, 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
connectOnLoad
property of thenetworked-scene
- let thedynamic-room
change the room, and then decide when to connect.Since
networked-scene
checks theconnectOnLoad
in init - it will always use the default value. We need to make sure the default isfalse
instead oftrue
.So two things need to be made:
change
networked-scene
defaults before the scene is initialized:emit
connect
when the room id is set:Check it out in this glitch