Realistic Sniper and Ballistics
  • Welcome
  • Introduction
    • Feature List
    • Why/How is it used?
    • Quick Setup
  • Getting Started
    • Getting Started
    • Environment Properties
    • Bullet Properties
    • Object Poolers
    • Sniper and Ballistics System
    • Firing a Bullet
    • Listening to Hit Events
      • Spawning Particles on Hit
      • Hit Tags
    • Zero Distances
    • Wind Vector
    • Air Resistance
    • Spin Drift
    • Ballistic Surfaces - Penetration
    • Ballistic Surfaces - Ricochet
    • Bullet Time Effects
      • Target
      • Bullet
      • Firing with Bullet Time
      • Bullet Time Camera - Default
      • Writing your Own Bullet Time Camera
    • Dynamic Scope System
    • Incorporating Player
      • Player Movement Controller
      • Motion Controller
      • Camera Controller
      • Player With Weapon
    • Mobile Controls
    • Conclusion
  • API
    • API Welcome
    • Sniper and Ballistics System
    • Dynamic Scope System
    • Player Movement Controller
    • Motion Controller
    • Ballistic Surface
    • Environment Properties
    • Ballistics Utility
    • Bullet Time Utility
Powered by GitBook
On this page

Was this helpful?

  1. Getting Started

Wind Vector

PreviousZero DistancesNextAir Resistance

Last updated 3 years ago

Was this helpful?

The wind vector affects how the bullet travels, which can be set in the Environment Properties asset. Select the Environment Properties asset we have created for this tutorial (it is referenced in Sniper and Ballistics object), then change the wind vector to 90, 0,0.

If we play the game and fire now, we will see the bullet landing to the right of our aim center.

If we set the zero distance to 500 as shown in the previous section, we will not see any bullet drop, but the wind will still affect the bullet. It is possible to dynamically change the wind vector by reaching to the SniperAndBallisticsSystem.instance.GlobalEnvironmentProperties.WindVector value. An example of this can be found under the folder InanEvin>Realistic Sniper and Ballistics>src>Utility, see the WindRandomizer.cs script.

Setting zero distances compensates for the bullet drop, and a scope system shall compensate for the wind vector. Ideally, we can write a scope system that will show us where the bullet will land depending on the current wind vector. The Dynamic Scope System in RSB does exactly this, which will be explained in the later sections.

Let's reset the wind vector to 0,0,0 before continuing the sections.

Wind vector set to 90, 0, 0
Bullet hitting to the right of our aim center, also dropping.