Skip to content

Zoom with the wheel and reset with the right button

Updated

The mouse wheel scales a model between half and three times its size, read with Input.mouse.wheelDelta(); a right click puts it back to its own size.

Turn the mouse wheel over the scene to grow or shrink the model, then right-click to reset it. Drag to orbit the camera.

Zoom with the wheel and reset with the right button

The script is explained step by step in Zoom with the wheel and reset with the right button.

Download the project file below, then import it in XR Hub with Projects › New › Import, as described in Projects and templates. It opens in XR Creator with the same scene you see running above, each script already attached to its Behavior entity. From there you can edit the scripts, adjust components and their props, preview your changes, and deploy the result as a world of your own.

WheelZoom.xrproj