I'm having two a-texts both directs to same html
<a-text navigate="url: http://../room.html" color="green" position="0 2 0" value="Room 1"></a-text>
<a-text navigate="url: http://../room.html" color="green" position="0 2 0" value="Room 2"></a-text>
navigate is a register component which helps to redirect to different url on clicking text entity
AFRAME.registerComponent("navigate-on-click", {
schema: {
url: { default: "" },
},
init: function () {
var data = this.data;
var el = this.el;
el.addEventListener("click", function () {
window.location.href = data.url;
});
},
});
but I want to use same html with different room name as room 1 and room 2 so user clicks on different texts enters different room with same html file
<a-scene
networked-scene="
room: room;
debug: true;
adapter: wseasyrtc;
serverURL:http://....com/;
">
here room name is hard coded as room but I want to make it dynamic
create a component for dynamic room like this
and in a-scene add the component
dynamic-room