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

Ballistic Surfaces - Ricochet

PreviousBallistic Surfaces - PenetrationNextBullet Time Effects

Last updated 3 years ago

Was this helpful?

Ricochet feature is extremely similar to the penetration feature. First, let's disable the penetration, but enable ricochet on our cube object.

The same principles apply as the penetration settings. The ricocheting bullet will lose it's kinetic energy based on the Energy Consumption. However, unlike penetration, the bullet will lose the energy only once, when it hits the object. So object's thickness play no role in here. Now, let's move our cube in X axis by 2 units, so it's position will be 2,2,10. Then rotate the cube on Y axis by 45 degrees so it's rotation will be 0,45,0. If you take a shot now, you will see the bullet ricocheting off the surface.

By changing Deflection Angles to a range between 10-20, we will get randomly deflecting bullet rays after ricocheting off the surface.

By playing with the values, you can create a penetrable/ricochet-able surface of your liking. You can take a look at the presets included to learn how to simulate some common surfaces.

If you want to use both penetration and ricochet at the same time on the same object, you should know that the system always favors penetration over ricochet. So a bullet ray hitting a surface, will first check if the object will have BallisticSurface.cs script on it. If so, it will FIRST check whether the penetration is enabled or not, and whether the current energy values allow penetrating the object. If that fails, ONLY THEN the ricochet settings are checked.

Ricochet settings enabled.
Bullet ray ricocheting off the surface of the cube.
Rays ricocheting off the surface, some of them even hit the ground.