- Home /
Scoping For Snipe Rifle
Ok i want some help on scoping for sipe rifles. So if i have a snipe rifle equiped and the player click the right mouse button i want him to zoom in and scope. So when he shoots it will hit around the spot where the little red dot is for help with scoping.
Thanks for any help if anyone can give me!
Answer by aldonaletto · Jun 11, 2011 at 06:10 PM
The best method requires Unity Pro and a second camera: you use this camera to aim and project its image in a Render Texture, which is your scope view.
If you don't have Pro, a cheaper way to do this is narrowing the camera's view angle, which produces a "zoom in" effect. Save Camera.main.fieldOfView in some float variable, then reduce fieldOfView to a smaller angle (say, 10), and when the right button is released restore the old fieldOfView value. Unfortunatelly, it affects the whole screen, but you can improve the effect with a crosshair aim GUI image to simulate a scope vision, for instance.
Your answer
![](https://koobas.hobune.stream/wayback/20220612103054im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
UnityScript Variable Scope? 2 Answers
Sniper Scope? 1 Answer
Animations all strung together 1 Answer
Instantiate bullet in time interval for "rifle". 2 Answers
Gui texture 2 Answers