Skip to main content

CollisionHaptic

A class in Root.Township, the global namespace.

Client: on a pickup, buzzes the holding controllers when it hits another pickup fast enough. Removed on headless servers.

Constructors​

MemberWhat it is
CollisionHaptic()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

4 private and internal fields
MemberWhat it is
private float hapticAmountHaptic strength.
private float hapticDurationHaptic length in seconds.
private float minimumSpeedForHapticsSquaredSquared speed both pickups together must pass.
private Pickup pickupThe pickup on this object.

Methods​

MemberWhat it is
void Haptics()Plays a flat haptic pulse on every controller holding this pickup.
2 private and internal methods
MemberWhat it is
private void Awake()Destroys itself on a headless build.
private void OnCollisionEnter(Collision collision)If it hit a pickup (or the root of a crafted one) and their summed squared speeds pass the minimum, runs Haptics.