A class in Root.Township, the global namespace.
Throwable pickup behaviour that adds torque on throw to turn a chosen local axis towards the throw direction, so things like spears fly point first.
Constructors
| Member | What it is |
|---|
ThrowAlignHelper() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
4 private and internal fields
| Member | What it is |
|---|
private Vector3 throwAlignTo | Local axis that should point along the throw. |
private Vector3 torque | Current blended torque. |
private float torqueLerp | How fast the torque blends towards the target, scaled by throw strength. |
private float torqueMultiplier | Scale on the applied torque. |
Methods
| Member | What it is |
|---|
protected override void ResetValues() | Clears the stored torque. |
protected override void ThrowBehaviour(Vector3 velocity, float throwMagnitude) | Works out the torque needed to turn throwAlignTo onto the velocity, blends it by throw strength and applies it as an impulse. |
1 private and internal method
| Member | What it is |
|---|
private void OnDrawGizmosSelected() | Draws the align axis as a blue line. |