Creating a laser aim with a projector
Although using UI elements, such as a cross-hair, is a valid way to allow players to aim, replacing (or combining) it with a projected laser dot might be a more interesting approach. In this recipe, we will use a light projector to implement this concept:

Getting ready
To help us with this recipe, in the 07_04
folder, we've provided a Unity package (laserAssets.unitypackage
) containing a sample scene featuring a character holding a laser pointer, and also a texture map named LineTexture
.
How to do it...
To create a laser dot aim with a Projector, follow these steps:
- Start a new 3D project.
- We'll be importing the
Projectors
components from the Unity Standard Assets. If you didn't install the Standard Assets when you installed Unity, go the the Asset Store and install the free Standard Assets now. - Import
laserAssets.unitypackage
into a new project. Then, open the scene namedbasic_scene_MsLaser
. This is a basic scene, featuring a player character in a maze, with...