Skip to main content

SpriggullFlail

A class in Root.Township, Alta.Intelligence.

Component on a spriggull that starts its flailing action when it is hit hard by a rigidbody on its hit collider. The flail only starts on the server.

Constructors​

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

Fields​

4 private and internal fields
MemberWhat it is
private Collider hitColliderThe only collider whose contacts count.
private Spriggull spriggullThe spriggull that flails.
private float strongFlailVelocityImpulse at or above which flail strength is 1 (default 2).
private float weakFlailVelocityImpulse at or below which the hit is ignored (default 1).

Methods​

1 private and internal method
MemberWhat it is
private void OnCollisionEnter(Collision collision)Ignores weak hits and any where a contact isn't on hitCollider; otherwise maps impulse to 0 to 1 and calls Spriggull.BeginFlail next frame.