Scripting in Unity - POINT-VR/POINT-VR-Chapter-1 GitHub Wiki

Intro to Unity Scripting

Unity Scripting should come out of the box as Unity automatically installs Visual Studio on your machine.

Making a Script

To make a script start by navigating into the assets window and right clicking.

Now hover over create and select C# script.

Doing this will create a new script object.

image

You can double click it to open it in Visual Studio.

Once you're done writing your script you can add it to an object in the inspector window.

And you're good to go!

Learning Scripting

To start working on the team, our only expectation is that you know how to make a script; most of the skills you need will be learned through experience. That being said, if you want to learn scripting before you start you'll only be more prepared.

Unity Learn has some initial guides to starting with scripting.

Below are some challenges to get you practicing some skills.

Level 1

Learn how scripts interact with UI. Make a UI element that is changes according to some script.

Level 2

Do some research and figure out what a coroutine is. Use a coroutine along with the transform component of a game object to create an animation of an object moving in space (For smooth motion you might want to research lerp).

Level 3

Learn Unity's user input system. Try to make an object that moves in 3D space based on the arrow keys. (Note that Unity updated their user input system in 2021 so resources from before then will be outdated).

Challenge

Combine how you learned to make a small game (maybe whack-a-mole or pong) that uses UI, coroutines and user input.