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
| Member | What it is |
|---|
SpriggullFlail() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
4 private and internal fields
| Member | What it is |
|---|
private Collider hitCollider | The only collider whose contacts count. |
private Spriggull spriggull | The spriggull that flails. |
private float strongFlailVelocity | Impulse at or above which flail strength is 1 (default 2). |
private float weakFlailVelocity | Impulse at or below which the hit is ignored (default 1). |
Methods
1 private and internal method
| Member | What 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. |