Bonus Features 1 - Share your Work

Exercise

Beginner

+60XP

1h

Unity Technologies

Bonus Features 1 - Share your Work

In this tutorial, you can go way above and beyond what you learned in this Unit and share what you’ve made with your fellow creators.

There are four bonus features presented in this tutorial marked as Easy, Medium, Hard, and Expert. You can attempt any number of these, put your own spin on them, and then share your work!

This tutorial is entirely optional, but highly recommended for anyone wishing to take their skills to a new level.

Languages available:

1. Overview

This tutorial is entirely optional. If you are not interested in this extra challenge, simply scroll to the bottom of the page above the Submission Gallery and select "Skip submission and continue". You can still successfully complete the course without attempting any of these bonus features.

This tutorial outlines four potential bonus features for the Driving Simulation Prototype at varying levels of difficulty:

  • Easy: Obstacle Pyramids
  • Medium: Oncoming vehicles
  • Hard: Camera switcher
  • Expert: Local multiplayer

Here’s what the prototype could look like if you complete all four features:

The Easy and Medium features can probably be completed entirely with skills from this course, but the Hard and Expert features will require some additional research.

Since this is optional, you can attempt none of them, all of them, or any combination in between.

You can come up with your own original bonus features as well!

Then, at the end of this tutorial, there is an opportunity to share your work.

We highly recommend that you attempt these using relentless Googling and troubleshooting, but if you do get completely stuck, there are hints and step-by-step solutions available below.

Good luck!

2. Easy: Obstacle pyramids

Create stacks, piles, or pyramids of obstacles for the vehicle to drive through.

These will be more satisfying for the player to crash into compared with single objects.

3. Medium: Oncoming vehicles

Add a couple of other cars that are automatically driving down the road in the opposite direction, which the player also has to avoid.

This will make the experience much more challenging, since the player will now be forced to think quickly, rather than taking as much time as they need.

4. Hard: Camera switcher

Allow the player to press a key on the keyboard to switch camera views.

Ideally, the same key would toggle between two views, one above and behind the vehicle, and the other from the perspective of the driver’s seat.

5. Expert: Local multiplayer

Transform this into a “local multiplayer” split-screen game with two cars, where one player’s car is controlled by WASD and the other is controlled by the arrow keys.

This would add a completely new competitive dimension to the prototype.

6. Hints and solution walkthrough

Hints:

  • Easy: Obstacle pyramids
    • Remember to use a Rigidbody!
  • Medium: Oncoming vehicles
    • Try using transform.Translate to move the other vehicles.
  • Hard: Camera switcher
    • Add a second camera and then use a key press to enable and disable it.
  • Expert: Local multiplayer
    • You will need to edit the Input Manager and the Camera’s Viewport Rect Width property.

Solution walkthrough

If you are really stuck, download the step-by-step solution walkthrough.

Note that there are likely many ways to implement these features - this is only one suggestion.

Optional step

7. Share your work

Have you implemented any of these bonus features? Have you added any new, unique features? Have you applied these new features to another project?

We would love to see what you've created!

Please take a screenshot of your project or do a screen-recording walking us through it, then post it here to share what you’ve made.

We highly recommend that you comment on at least one other creator's submission. What do you like about the project? What would be a cool new feature they might consider adding?

Please login to submit

Complete this Tutorial

Submission Gallery

Heads Up: Highway Hazzard

Heads Up: Highway Hazzard

2P Split-Screen Racer! Crash obstacles & avoid traffic. P1: WASD to drive, F to switch view. P2: Arrow Keys to drive, Right Shift to switch view. Built for the Unity Junior Programmer Certification. I added all the bounus features. Debugging assistance provided by Google's Gemini AI.

G
ginagroce3
0
0
BONUS BONUS

BONUS BONUS

had a lot of fun doing the first challenge and the bonus tasks, felt like I've really absorbed some of the material and kneww how to make use of it. Also enjoyed searching for methods of implementation on the internet, testing different methods and troubleshooting them to suit my project.

A
alenelis
4
0
Bonus Features

Bonus Features

Implemented all 4 bonus features for the Create with code pathway.

A
ateefreak
4
1
Hell_Road

Hell_Road

A road with many obstacles and dangers, will you survive ?

U
UncleBenzee
8
0
Bonus Features

Bonus Features

Bonus features mission from Unity tutorial. # Controls # - Blue car - 1. Use WASD to move 2. LeftShift for Turbo 3. C to Change view - Red truck - 1. Arrow Keys to move 2. Numpad 0 for turbo 3. Right Ctrl to change view Press F9 to see top view displayed in fullscreen

P
piyapank175
8
0
Prototype 1: Bonus Features

Prototype 1: Bonus Features

This bonus features challenge included the solution from the discussion onto which I wasn't able to solve on my own based on my paradigm. The extras I have added into my work is the finishing line for the winner and displaying the text using TMPro. Succeeded without discussion: 1. Obstacle pyramids 2. Oncoming vehicles 3. Local multiplayer Succeeded with discussion: 1. Camera switcher Originally, my idea of the flow does not consist of using boolean as the switch on/off for the camera switcher. I had thought of clicking one key (eg: 'C') to receive input from player to switch the POV by allocating different offsets to indicate the player's view to be inside the car. However, the flaw was I was unable to switch back to the original camera position without using boolean. Added feature: 1. Finishing line text This idea was helped A LOT by AI (I'm terribly sorry to myself especially). My idea was there, but I just don't know the exact documentation that could help me solve the connection between TMPro and Box Colliders. Turns out, the helpful OnTriggerEnter() onto my rescue. Here is what I learnt: - Must export TextMeshProUGUI in the script. - Use GameObject from the MonoBehaviour class to enable the status of the text to true or false (in a sense, like a Boolean). - Using tag and label the player in the Inspector to easily use CompareTag from Transform library. - Stop overwriting the status of the actual winner of the race by using boolean status. If no use boolean, then when a player has won the game but the other player relentlessly make their way to touch the finishing line, the text will also appear on the losing side too. I was trying to make sure the losing text also appear on the losing side using a listener event, but to no avail I didn't make it work. I don't want to rely AI for this one, so I might come back to solve this one once I get more familiar with the library by learning the next tutorials. Until then.

G
gimme_alempeng
2
0