Writing your own bullet-time camera
Drive a custom camera through the four bullet-time events.
Copy src/BulletTime/BulletTimeCameraEmpty.cs into your own code and rename the class. It contains subscription, cleanup and camera-lifecycle scaffolding. Use it instead of the default effect controller so both do not compete for the camera or virtual timescale.
| Event | Handler signature | Responsibility |
|---|---|---|
EBulletTimeStarted | (Transform bullet, Transform hitTarget, ref List<BulletPoint> bulletPath, float totalDistance) | Store references, configure waits and enable the camera. |
EBulletTimeUpdated | (float distanceTravelled, float totalDistance) | Respond to progress along the path. |
EBulletTimePathFinished | () | Respond when path playback finishes. |
EBulletTimeEnded | () | Clear references and disable the cinematic camera. |
Subscribe in OnEnable and unsubscribe in OnDisable. The start handler must include ref before the path parameter. Keep the GameObject and listener enabled while waiting for a shot; disable only the Camera component.
Use BulletTimeUtility.SetVirtualTimescale(0.05f) to control bullet playback speed. Let the system manage actual Time.timeScale. Use Time.unscaledDeltaTime for camera interpolation because scaled delta time is extremely small during the sequence.
For a simple follow position in LateUpdate, use the bullet's local frame:
cameraTransform.position = bullet.position + bullet.rotation * offset;
cameraTransform.LookAt(bullet.position);The template leaves movement and look logic for you to implement. Avoid a slow smoothing operation that cannot keep up with a fast bullet. Use BulletTimeSkipPoint only when deliberately skipping part of a path, and restore it when playback should resume.