Play through the first camera that is switched on

The game view took whatever camera came first in the scene, ignoring the
switch, so `enabled = false` on a camera did nothing and a second camera
never got its turn. `World.activeCamera()` now decides: of the cameras
switched on – the whole parent chain counted, as for any object – the
first in hierarchy order, and none on renders nothing at all. It is asked
per frame, so a graph switching cameras hands the view over immediately.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
rootandClaude Opus 5 committed 2026-09-09 16:13:30 +02:00
1 parent 75be133374
commit 37fff5dabf
8 files changed
+227 -13

No files matched your search

+2 -2
View File
@@ -79,9 +79,9 @@ export class PlaySession {
this.host.gameView.setWorld(world);
this.host.showGame();
this.state.setNotice(
world.firstOfType('camera')
world.activeCamera()
? 'Playing · edits are not saved · Esc stops'
: 'This scene has no camera – nothing is rendered · Esc stops',
: 'No camera is switched on – nothing is rendered · Esc stops',
);
if (world.stopRequested) this.stop();
}