1. Home
  2. Docs
  3. Crosshair Assembler (Unity)
  4. Getting Started: Assemble Your First Crosshair
  5. Step 2: Add Building Blocks and Adjust Parameters

Step 2: Add Building Blocks and Adjust Parameters

In step 2, we will add building blocks (we will call them layers) and adjust their parameters to make the crosshair.

We will use three layers for this crosshair: CLCenterCircle for a center dot, CLSurroundLines for four surround lines, and CLSurroundArcs for four surround arcs.

 

To make the crosshair we are designing visible in the editor, drag the empty crosshair prefab MyFirstCrosshair under the CrosshairCanvas on the hierarchy to make a child of the CrosshairCanvas.

 

We will then add and adjust building blocks to the crosshair one-by-one.

Open the folder CrosshairAssembler/CrosshairImplementation/Scripts/CrosshairLayers. Find the CLCenterCircle layer.

 

Then drag it to the designer center viewport or use “Add Component’ button to add the script. By doing so, a circle is shown in the game display.

 

To make it like a dot, in the Inspector CL Center Circle (script) component, check Fill, change Line thickness to 0, and change Radius to 3.0.

 

Add the CL Surround Lines component to the MyFirstCrosshair.

 

Then in the Inspector – CL Surround Lines (Script) component, change Line Size to 2, 40 to make it longer (2 pixels wide and 40 pixels long).

 

Go to the Inspector – CL Surround Lines (Script) component – Surround Arrangement and change Center Gap to 30 to make the surround lines farther from the center.

 

Add component CL Surround Arcs layer.

 

Go to the Inspector – CL Surround Arcs – Transform, and change Layer Angle to 45 to arrange the arcs on the diagonals.

 

Press Apply to save for the prefab.

 

 

We finished making the first crosshair.

Try changing other parameters in the Crosshair Layer category of Inspector of each layer and see the result.

 

Was this article helpful to you? Yes No

How can we help?