File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -380,6 +380,15 @@ class CameraControls extends Script {
380380 // mode
381381 this . _setMode ( 'orbit' ) ;
382382
383+ // state
384+ this . on ( 'state' , ( ) => {
385+ // discard inputs
386+ this . _desktopInput . read ( ) ;
387+ this . _orbitMobileInput . read ( ) ;
388+ this . _flyMobileInput . read ( ) ;
389+ this . _gamepadInput . read ( ) ;
390+ } ) ;
391+
383392 // destroy
384393 this . on ( 'destroy' , this . _destroy , this ) ;
385394 }
@@ -796,8 +805,8 @@ class CameraControls extends Script {
796805 v . add ( stickRotate . mulScalar ( fly * rotateJoystickMult ) ) ;
797806 deltas . rotate . append ( [ v . x , v . y , v . z ] ) ;
798807
799- // check for frame discard (entity disabled, xr active or skipUpdate)
800- if ( this . app . xr ?. active || ! this . entity . enabled || this . skipUpdate ) {
808+ // check for frame discard (xr active or skipUpdate)
809+ if ( this . app . xr ?. active || this . skipUpdate ) {
801810 frame . read ( ) ;
802811 return ;
803812 }
You can’t perform that action at this time.
0 commit comments