Lab 1 - Roll A Ball: Environment and Player

This assignment is due on Friday 4/6.

For the first few lab assignments, we will be building the “Roll a Ball” game following the official Unity tutorials. These are video tutorials, so I will include textual and simplified instructions but you can also watch the video if anything is unclear or if you would like further explanation.

Before you start, you should familiarize yourself with the Unity Editor Layout. Not included in that article is the group of standard drop-down menus that are above the editor (File, Edit, etc.) which is called the Menu Bar.

Part 1: Scene Setup




Part 2: Moving the Player

private Rigidbody rb;
rb = GetComponent<Rigidbody>();
float moveHorizontal = Input.GetAxis("Horizontal");
float moveVertical = Input.GetAxis("Vertical");
Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
rb.AddForce(movement);

rb.AddForce(movement * speed);