Training Center

Binocular GUI

Binocular GUI

You'll learn how to create a high-tech binocular effect for your game, complete with distance readouts, faux night vision, and an interactive camera zoom. This can be integrated into any player-controlled camera and would probably be most at home in a first-person game. The sky's the limit; take what you learn here and run with it!

An overview of the binocular feature we're going to implement in this module. You'll create an interactive high-tech binocular overlay effect.

Additional Info

  • Runtime 01 min 44 sec
  • Software Unity
Login to download project files

Here we set up a new scene in which we can test our binocular effect.

Additional Info

  • Runtime 02 min 16 sec
  • Software Unity

Learn how to create a basic distance readout by casting a ray from your camera into your scene, detecting where it hits, and displaying the hit distance using a GUI Text component.

Additional Info

  • Runtime 06 min 42 sec
  • Software Unity

You'll be able to create all the 2D assets you need for the binoculars from scratch in Photoshop. We guide you through that process; feel free to add your own creative touches!

Additional Info

  • Runtime 19 min 53 sec
  • Software Photoshop

We need to add our new custom graphics to our Unity project before we can use them. The asset importer makes this a simple task.

Additional Info

  • Runtime 01 min 27 sec
  • Software Unity

We make a new script for all our overlay textures so we can more easily control their size and position on screen.

Additional Info

  • Runtime 04 min 02 sec
  • Software Unity

We begin to construct the binocular object by putting the 2D images into GUI Texture components, properly positioning them onscreen, and creating a hierarchy to organize everything.

Additional Info

  • Runtime 05 min 59 sec
  • Software Unity

Learn how to implement crosshairs in your game. We need to disable the cursor and use a custom graphic instead.

Additional Info

  • Runtime 07 min 19 sec
  • Software Unity

We start to add user control to the binoculars, allowing a player to turn them on or off. This requires us to access all the GUI components so we can selectively enable them.

Additional Info

  • Runtime 07 min 14 sec
  • Software Unity

We still need to implement the arrow effects, so we position the arrows and tie them to user input so they light up as the player moves around.

Additional Info

  • Runtime 14 min 45 sec
  • Software Unity

We add the zoom functionality to the binoculars, letting the player toggle between several different camera focal lengths. We also adjust the arrows to make them work better.

Additional Info

  • Runtime 17 min 43 sec
  • Software Unity

Here we fully implement the distance readout from earlier. We use a GUI Skin to enhance its look and reposition it on screen.

Additional Info

  • Runtime 10 min 30 sec
  • Software Unity

Chapter List

Questions? ¿Preguntas? 有问题吗? Domande? Вопросы? 質問はありますか? सवाल? الأسئلة؟
This email address is being protected from spambots. You need JavaScript enabled to view it.

About design3

design3 is THE game production web portal. Whether you’re an industry veteran keeping up with new tools and trends or an aspiring developer searching for professional training, expert advice and career tips – design3.com is where you need to be.

Sign-up for our newsletter!

:

Copyright © 2006 - 2012 design3. All rights reserved.

Sign In or Become a member

Facebook user?

You can use your Facebook account to sign into our site.

Log in with Facebook

LOG IN