Pump it Full of Lead
Just a few more tasks lie between you and sniping the day away. It does seem like a good idea to add bullets to your gun — of course, you can skip this step, but sniping just wouldn’t be the same. :] Previously the Pistol and Shotgun weapons already had bullets set up. You created the sniper rifle from scratch, and so you’ll also need to configure a prefab to use for its bullets.
While you’re still in 3Sniper, expand vp_FPWeaponShooter then expand the Projectile section. Click the small selector button to the right of the Prefab field. Find and select the PistolBullet prefab.
Click Play, and focus on the most distant target — you may need to turn around. Press the RMB to zoom then fire the sniper rifle!
Now you get the effect of looking down the scope before zooming in. Great zoom’n, partner. :]
Where To Go From Here
Oh, the places you can go from here. Where to start? UFPS is a rich framework and this tutorial just scratches the surface of what’s possible.
A logical next step would be to add an assault rifle complete with realistic animations. Play with the sliders and values in the vp_FPWeapon until it looks and feels right. Remember it should shoot very quickly and have a fast-but-small recoil after each shot.
You covered the basics, but there’s still a lot more to learn in the UFPS documentation. For one, you didn’t touch vp_FXBullet. Another key feature to FPS games is inventory and ammo management, which involves working with the UI.
You didn’t get to experience UFPS’ many cool features — so check them out!
Work through these tutorials if you’d like to learn more about the Unity UI system:
Or pick up Unity Games by Tutorials and learn Unity from the inside out while you build four awesome games.
As I mentioned earlier, reflection is an advanced skill that’s a great tool to have in your coding toolbox, so read up on it when you get a chance.
Lean more about how the event system works by watching this official Unity Events tutorial
If you have questions, feedback or just want to ask for more UFPS tutorials, leave a comment in our forums. Your feedback determines what we write next — so speak up!
Acknowledgments
Special thanks to Wojciech Klimas for the gun models. See more good work here: