Unity FPS Tutorial - How To Create Crosshairs

Опубликовано: 09 Май 2026
на канале: Tvtig
10,043
147

#unity3d #unityfps #fps

I am back with another Unity FPS tutorial! And this time we will be looking at how to create a crosshairs for your FPS game.

I used substance designer to create a texture consisting of a few crosshairs, Substance designer is quickly becoming my go to for creating textures for use in my game development projects. The ease, and speed at which you can create simple or complex textures in Substance is such an advantage to the entire game development process. So please let me know if you would like me to share what I learn about Substance designer and painter along the way.

After creating the Crosshair texture which you can find here: https://github.com/Tvtig/UnityOpenFPS..., we create an unlit Shader graph, and use a flipbook node to drive which crosshair on the texture sheet we want to use. We turn that into a variable so that we can select the index of the crosshair from the texture sheet, directly from the material, this will make it easy to manage from within our game or code. We also add a colour variable to the Shader graph which is multiplied by the green channel of our texture. I enabled HDR because I look the look of a glowing crosshair in the FPS world I have created for this series.

Once the FPS Crosshair Shader has been created, we can create a material from it, which can then be dragged onto a plane, which is placed in front of the main camera and scaled down, this plane is the object that we will use to render our crosshair. Remember to remove the mesh collider from the plane, otherwise all rays that you try to cast into your scene will be swallowed by your plane and your collisions won't happen when you try to actually shoot things in the scene.

The last step is to create a script which will manage the scale of the FPS crosshair, so that it can increase or decrease when the player is walking, running or shooting the gun. I'll take you through those steps in the video, as they might be a bit confusing to read.

You can find the code linked here: https://github.com/Tvtig/UnityOpenFPS