(It is also good practice not to handle it in the Update function directly, but this is the smallest of projects and we're not going to over-engineer it.) In Unity games, it is common practice to use the Update function to detect player input.
Will be true as long as the mouse is down or a touch is happening. Will be true only in the 1st frame in which it detects the mouse is down (or a tap is happening) Open CameraMovement.cs with your editor, time to code! public class CameraMovement : MonoBehaviour Of course you can arrange your files and classes however you prefer.) (This is the most basic setup working with an empty project. This created a " CameraMovement.cs" file in your Assets folder, which contains an empty CameraMovement class that extends MonoBehaviour.
The screen (the viewport rather) has a size of 1x1 in viewport coordinates.