- Home /
Drawing crosshairs and other 2D graphics onto the screen?
I'm trying to develop a demo for an FPS here on Unity, and it's been going good so far (with the help of Unity Answers in some places). However, I'm trying to implement a firing system, but I'm not sure how to draw a crosshair. Does Unity allow making 2D GameObjects of which are scaled by pixels instead of units? I'm familiar with making 2D games where everything is scaled in pixels, but I'm not sure if you can do that with Unity. Any help would be appreciated, Thanks!
Answer by Rennat · Sep 01, 2011 at 04:14 AM
You can use a `GuiTexture` to draw 2d assets using pixel dimensions.
Thanks! You posted first, so I guess I'll mark you as correct :) I'm sure this will help a lot.
you should give him a thumbs up if his answer was right so his credit will show on his karma
Oh, I thought marking correct gave karma..sorry, I'm still not familiar with the way this site works, heh...well, I gave thumb-ups to both answerers.
Answer by Adamcbrz · Sep 01, 2011 at 04:17 AM
Look into GUI Textures. Most the time this accomplishes what you are looking for with a crosshair. The easiest way to handle this is to create the 2D image and add it to your assets. Then with that image selected Add new GUI Texture and that texture will be applied at the size of the image.
Your answer
Follow this Question
Related Questions
2D graphic problem with tilemap and resolution 0 Answers
Sidescroll Shooter Crosshair? 0 Answers
Best way to draw an ECG trace. 2 Answers
Choppy on iPhone only... 1 Answer