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
  2. Bullet Time Effects

Firing with Bullet Time

PreviousBulletNextBullet Time Camera - Default

Last updated 3 years ago

Was this helpful?

Open up our Tutorial.cs script. We need to create a reference to the transform of the bullet object, as well as to the main camera.

Then we will need to send this object to the system when we are requesting to fire. Remember the FireBallisticsBullet method. The method actually can take two more parameters which are null by default:

  • bulletTimeTransform: This is the transform where the bullet will come out of during bullet time effects (e.g an empty object at the end of the weapon barrel). For now, we will use the main camera transform for it.

  • bulletTimeBullet: The transform of the bullet object that will be moving towards the target during bullet time.

So, now let's update our call by incorporating these two values in it.

So, our whole Tutorial.cs script now looks like this:

Do not forget to assign the transforms in the inspector of Tutorial object.

If we have fired now, again nothing would change in the scene. This is because even though RSB is now ready to fire up bullet time events, there is no listener in the scene to react to those events. Thats where BulletTimeCameraDefault script comes in play, now let's take a look at that.

Updated Tutorial.cs script, now we use mainCamera & bulletTimeBullet objects in our Fire call.
Transforms assigned in Tutorial.cs