- Home /
Sniper Scope With GUI Texture
Hey, how to make a GUI Texture display a sniper scope, I would use the right mouse button to activate scope.
$$anonymous$$aybe you could draw a picture of what you are trying to do?
Answer by Ben-Stoneman · Feb 14, 2013 at 03:54 PM
If you wish to create a sniper scope to place over the camera for a sniper game, like the image below, The Steps to achieve this follow.
Create a sniper scope of your choice and place it in the center of a image matching your game's resolution, ensure the background is black and the scope's viewpoints are transparent.
Create a GUI Texture ( GameObject > Create Other > GUI Texture )
Attach the image on the GUI Texture.
In the Inspector (for the GUI Texture) set the Pixel Inset Width and Height to the same resolution as the scope image.
Center the GUI Texture.
To activate and de-activate the scope simple enable and disable the GUI Texture the scope is attached to.
http://docs.unity3d.com/Documentation/ScriptReference/Behaviour-enabled.html?from=GUITexture
Done! It is the most simple way of doing this sniper scope but can be quite effective for mobile games.
Your answer
Follow this Question
Related Questions
Gun Scope Not Centered 1 Answer
why does my object reference go out of scope? 1 Answer
free aim down sights script here 0 Answers
Google Drive Plugin - full access from android device 1 Answer