Skip to content

Commit 88eb4f4

Browse files
committed
The Pointer.camera property would only be set if there was a viable Game Object in the camera view. Now it is set regardless, to always be the Camera the Pointer interacted with.
1 parent f2b7fd0 commit 88eb4f4

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/input/InputPlugin.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ var InputPlugin = new Class({
683683
{
684684
var camera = cameras[c];
685685

686-
// Get a list of all objects that can be seen by the camera below the pointer in the scene and store in 'output' array.
686+
// Get a list of all objects that can be seen by the camera below the pointer in the scene and store in 'over' array.
687687
// All objects in this array are input enabled, as checked by the hitTest method, so we don't need to check later on as well.
688688
var over = this.manager.hitTest(pointer, this._list, camera);
689689

@@ -706,6 +706,11 @@ var InputPlugin = new Class({
706706
}
707707
}
708708

709+
// If we got this far then there were no Game Objects below the pointer, but it was still over
710+
// a camera, so set that the top-most one into the pointer
711+
712+
pointer.camera = cameras[0];
713+
709714
return [];
710715
},
711716

0 commit comments

Comments
 (0)