Can we disable camera scroll and keyboard input on camera

I am working on a first person view, and I just want my mouse click to be enabled.

How do I disable keyboard and mouse middle scroll button so that camera stays where it is.

Nipun David

Here we are:

Hi @Deltakosh ,

So I used the lowerRadiusLimit, and upperRadiusLimit on camera and adjusted set them to 1.

But something weird is happening in my code when the upperRadiusLimit = 1, my environment sort of a shrinked. I am attaching screenshot

<Engine canvasId='sample-canvas'
            adaptToDeviceRatio={true} >
            <Scene onMeshPicked={meshPicked} onSceneMount={onSceneMount}>
                  enableGroundShadow: true,
                  groundYBias: 1}}

since I am using babylon with react I am using the above environment helper to draw the gray room which you can see on the screenshot below but it shrinks when I change the camera radius limit, not sure what is the reason please suggest the right way.

this seems to work fine in the example I created using the above code - line 58,59,60

Nipun David

You must set upper and lower radius compatible with your radius, meaning lower <= radius <= upper.

If your radius is initially not in this range, it will be reset and so your camera will change position.

that is not the issue when I set the values with out the react-environment it is working fine but when I enabled the that react-component the size of the default environment reduces a lot (last image above)

so instead of using react-component i used

scene.createDefaultEnvironment() in onSceneMount()

and it solved it. I think there is some internal issue with the linking of react components in the core babylonJS components.

anyway I found the workaround.

1 Like