Assignment 4: Flythrough Tour

Due Friday, September 27, before midnight

The goals for this assignment are:

  • Implement a Flythrough camera

  • Work with Lerp and Slerp

  • Find a model to serve as your player character

1. Getting Started

It is not necessary to fetch from the upstream repository this week. Instead,

  • Create a new scene, called A04_Tour, and save it to your HelloUnity/Assets/Scenes folder.

2. Assignment Goals

The primary goal of this assignment is to implement an interactive tour of the level you built last week. Your demo should support two features:

  • a set of point-of-interest waypoints that the user can switch between using the N key

  • a flythrough camera, controlled with the mouse and keyboard

The secondary goal is to find a model that can serve as the player.

2.1. Scene and Player Setup

Create a prefab of your level from assignment 3. When you create the scene for this assignment, you can use your prefab. Any changes you make to the prefab will propagate to other scenes automatically. If you do not use prefabs, you must re-do any changes manually across scenes.

Your player model needs to contain the following

  • Mesh with skeleton

  • Idle and locomotion animation

There are many online resources for game assets. Many of them will also have some models that ae free. Below are a few to get you started.

You are welcome to use the cat asset that I have been using for demos: Lowpoly Toon Cat by Omabuarts Studio NOTE: You are also welcome to use the third person controller in Unity’s standard assets. However, you will need to customize it using your own scripts. NOTE: Create a Scripts directory to hold your game scripts NOTE: Create a Prefabs directory to hold your game Prefabs

2.2. Flythrough Camera

Write a script, Scripts/FlyCamera.cs, that is a component for a camera object. Your Flythrough Camera should support the following features

  • Mouse move should rotate the camera up/down and left/right

  • The keyboard keys WASD should move the camera forward/back/left/right relative to the camera

  • Use GetAxis to get the mouse movement each frame

2.3. Tour

Write a script, Scripts/Tour.cs, that is a component for an empty GameObject. Your tour script should support the following features

  • The 'N' key travels to the next point-of-interest (POI)

  • Use an array of Transforms to store the list of of POIs

  • You can set up POIs in your scene using empty GameObjects. See the class demo for details.

  • Use Lerp and Slerp to transition from the current camera location and orientation to the next POI.

  • Your Tour script must include a speed parameter that controls the camera speed as it moves between POIs.

  • Your tour script must compute the durations of each transition using the speed parameter.

  • Do not use Coroutines for the transition. Instead use the Update() method with instance variables to handle state.

The following video shows how the tour should work in your scene

3. What to hand in

  • Your scene with your level in it

  • Your added character

  • Updated README

    • Screenshots showing the features of your level

    • A video or GIF showing the POIs with Flythrough camera

    • Credits/links for any assets that you did not make yourself.

Don’t forget to commit your changes and then push them to Github. Using Git Bash, run the following command inside your HelloUnity directory.

$ cd HelloUnity
$ git add .
$ git commit -m "Finished HelloUnity"
$ git push

Run git status to check the result of the previous git command. Check the Github website to make sure that your program uploaded correctly.

Assignment rubrics

Grades are out of 4 points.

  • Flythrough camera (1 points)

  • Tour script (1 points)

  • Player character (1 points)

  • Readme (1 point)

Submission rubrics

For full credit, your submission must

  • Include a level with both a home and quest area

  • Include a skybox that is different from the default

  • Stay under the polygon count

  • Be organized in terms of Models, Materials, Textures, etc folders

  • Show effort and imagination — minimally fulfilling requirements will earn you a B (3.0)

  • Some credit lost for missing features or bugs, depending on severity of error

  • -100% for failure to checkin work to Github

  • -100% for failure to build and run on the lab Windows machines