I’m making a first person game where you pick up and move objects around, and I’ve made a circular crosshair, put it on a plane, made it a child of the First Person Controller, but whenever I look around in the game, the crosshair goes through walls, despite its closeness to the player, and it won’t move up or down. What am I doing wrong here?
Create a Canvas by following thees steps.
- click on " GameObject" top of the unity window and then UI > Canvas
- Select the canvas in your Hierachy window and click on " GameObject > image.
- Import your crosshair texture to unity and change the texture type from " Texture" to “Sprite 2d and UI”
- change the UI image component to your crosshair texture.
- select your canvas and change the “Ui Scale mode " from Constant Pixel Size to " Scale with screen size”
For anyone having issues getting your crosshair/reticle image to appear in the middle of the screen with the steps above, try using a Panel (so hierarchy is Canvas > Panel > Image)
here’s a good, quick tutorial on creating a dynamic crosshair/reticle - How to Create a Simple Dynamic Crosshair (Unity3D, C#, Game Design) - YouTube
and this guy created 200 crosshairs that you can download for free - Crosshair Pack · Kenney