Reputation: 146
A component I'm making needs the default camera, but this.el.sceneEl.camera
returns undefined
.
AFRAME.registerComponent('test', {
init: function () {
console.log(this.el.sceneEl.camera)
}
});
How can I retrieve the camera?
Upvotes: 2
Views: 611
Reputation: 13233
Might have to wait for the camera to be set? Need to document this, but there's an event:
this.el.sceneEl.addEventListener('camera-set-active', function (evt) {
console.log(evt.detail.cameraEl);
});
Upvotes: 4