RSBDOCS
API reference

SniperAndBallisticsSystem

Firing, zero distances, runtime settings and static events.

Source: src/System/SniperAndBallisticsSystem.cs. Access the configured scene instance through SniperAndBallisticsSystem.instance (read-only, inherited from Singleton<T>).

Methods

void ActivateBullet(BulletProperties properties)
void FireBallisticsBullet(BulletProperties properties,
    Transform bulletTimeTransform = null, Transform bulletTimeBullet = null)
long FireBallisticsBullet(BulletProperties properties,
    BulletShotParameters parameters)
void CycleZeroDistanceUp()
void CycleZeroDistanceDown()

ActivateBullet calculates trajectory information for the scene's zero distances, marks the asset ready, then invokes EBulletActivated(properties). Each call raises the event after preparation, including repeated calls for the same asset. Call it before firing each bullet type, after the scene system has initialized.

The legacy void overload captures the configured Fire Transform, current zero distance and system mask. It retains its optional cinematic transforms and existing caller signature. Its hits now have shot IDs, with a null shooter.

The per-shot overload accepts BulletShotParameters and returns a positive long ID for an accepted shot, or 0 if rejected. It works without FireTransform. It validates the bullet's activation, finite origin/nonzero finite direction, and a non-negative prepared zero distance. Position, normalized direction, zeroing angle, mask and ownership settings are captured for that shot. See Multiple shooters.

Both overloads reject new shots during an active global bullet-time sequence. Per-shot requests default to AllowBulletTime false; the legacy overload retains the system's cinematic behavior when a visual bullet is supplied. BulletTimeOrigin is cosmetic and defaults to the simulation origin when omitted. Events may occur during the call, so use the ID on their payload rather than assuming the call has returned.

Zero-distance changes are bounded at either end, not wrapped. EZeroDistanceChanged fires only when the selection changes.

Properties and fields

MemberType / accessMeaning
CurrentZeroDistancefloat, readSelected zero distance in world metres.
BulletTimeRunningbool, readWhether a sequence is running.
GlobalEnvironmentPropertiesEnvironmentProperties, readThe runtime clone; its public metric fields are writable.
FireTransformTransform, read/writeRay origin and direction for legacy calls; the per-shot overload supplies its own.
UseInGameTrajectorybool, read/writeEnable trajectory LineRenderer output; requires a pool.
UseTracersbool, read/writeEnable pooled tracers.
UseBulletTimebool, read/writeEnable the bullet-time eligibility check.
BulletTimeChancefloat, read/writeProbability in the 0–1 range; setters do not clamp.
BulletTimeVirtualTimescalefloat, read/writeMultiplier for cinematic bullet playback.
BulletTimeWaitBeforeResettingTimescalefloat, read/writeWait after path playback, before actual time resets.
BulletTimeWaitBeforeEndingfloat, read/writeAdditional wait before sequence end.
BulletTimeSkipPointbool, read/writeSkip playback points immediately while true.

MeasurementUnits is the nested enum Imperial, Metric. Asset display choices do not change the metric runtime APIs.

Static events

EventsDelegate / parameters
EPenetrationInHit, EPenetrationOutHit, ERicochetHit, ENormalHit, EAnyHitBulletHitEvent(BulletPoint bulletPoint)
EBulletTimeStartedBulletTimeStartEvent(Transform bullet, Transform hitTarget, ref List<BulletPoint> bulletPath, float totalDistance)
EBulletTimeUpdatedBulletTimeUpdateEvent(float distanceTravelled, float totalDistance)
EBulletTimePathFinished, EBulletTimeEndedBulletTimeEndEvent()
EZeroDistanceChangedZeroDistanceEvent()
EBulletActivatedBulletPropertiesEvent(BulletProperties properties) — raised after ActivateBullet finishes preparation.

Subscribe before calling ActivateBullet if you need its notification. The event is synchronous and does not replay earlier activations. Subscribe and unsubscribe in matching component lifecycle methods. Hit events are global; BulletPoint describes their payload.

On this page