Reader small image

You're reading from  Unity Virtual Reality Projects

Product typeBook
Published inSep 2015
Reading LevelIntermediate
PublisherPackt
ISBN-139781783988556
Edition1st Edition
Languages
Right arrow
Author (1)
Jonathan Linowes
Jonathan Linowes
author image
Jonathan Linowes

Jonathan Linowes is a VR/AR enthusiast, Unity, and full stack developer, entrepreneur, certified Unity instructor, and the owner of Parkerhill XR Studio, an immersive media, applications, and game developer. Jonathan has a bachelor of fine arts degree from Syracuse University, a master of science degree from the MIT Media Lab, and has held technical leadership positions at Autodesk and other companies. He has authored multiple books on VR and AR published by Packt Publishing.
Read more about Jonathan Linowes

Right arrow

The reticle cursor


A variant of the visor HUD that is essential in first-person shooter games is a reticle or crosshair cursor. The analogy here is that you're looking through a gun-sight or an eyepiece (rather than a visor), and your head movement is moving in unison with the gun or turret itself. You can do this with a regular game object (for example, Quad + texture image), but this chapter is about UI. So, let's use our canvas, as follows:

  1. Find your Main Camera object in the Hierarchy panel.

  2. From the Project panel, drag the DefaultCanvas prefab onto the camera object so that it becomes a child of the camera. Name it ReticleCursor.

  3. Set the Rect Transform component's Pos X, Pos Y, Pos Z to (0, 0, 1).

  4. Delete its child objects—Image and Text.

  5. Add a raw image child by selecting from the main menu bar navigating through GameObject | UI | Raw Image and making sure that it's a child of ReticleCursor.

  6. In the Raw Image panel's Rect Transform, set Pos X, Pos Y, Pos Z to (0, 0, 0) and Width, Height to...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Unity Virtual Reality Projects
Published in: Sep 2015Publisher: PacktISBN-13: 9781783988556

Author (1)

author image
Jonathan Linowes

Jonathan Linowes is a VR/AR enthusiast, Unity, and full stack developer, entrepreneur, certified Unity instructor, and the owner of Parkerhill XR Studio, an immersive media, applications, and game developer. Jonathan has a bachelor of fine arts degree from Syracuse University, a master of science degree from the MIT Media Lab, and has held technical leadership positions at Autodesk and other companies. He has authored multiple books on VR and AR published by Packt Publishing.
Read more about Jonathan Linowes