Firing with Bullet Time

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.

Last updated