Creating the assets
We will need to create a new folder in the Assets folder named Scripts. It is a good idea to have all your assets organized--Unity is file-and folder-based, and thus it can be hard to find your items again.
Just create a folder by right-clicking on the Assets tab, and selecting Folder. Name this Scripts.
Inside Scripts, we will add the script, called cursor. Unity will add the extension .cs to the file, so do not worry about that.
If you have done that, you can drag the newly created script and drop it on top of the main camera in the hierarchy. While we are dragging items, drag the cursor asset to the scene as well. Do not worry about the location; we will change the location at every frame anyway, so it does not matter ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access