Skip to content

Commit 4ca3b7c

Browse files
fernandojsgdmarcos
authored andcommitted
Added camera.play() in setActiveCamera and move event emission to the end (#1502)
1 parent e1439ad commit 4ca3b7c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/systems/camera.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ module.exports.System = registerSystem('camera', {
7777

7878
// Make new camera active.
7979
this.activeCameraEl = newCameraEl;
80+
this.activeCameraEl.play();
8081
sceneEl.camera = newCamera;
81-
sceneEl.emit('camera-set-active', {cameraEl: newCameraEl});
8282

8383
// Disable current camera
8484
if (previousCamera) {
@@ -91,6 +91,7 @@ module.exports.System = registerSystem('camera', {
9191
cameraEl.setAttribute('camera', 'active', false);
9292
cameraEl.pause();
9393
}
94+
sceneEl.emit('camera-set-active', {cameraEl: newCameraEl});
9495
}
9596
});
9697

0 commit comments

Comments
 (0)