Crank
A class in Root.Township, Alta.Mechanisms.
A hand crank Mechanism: turns with the player's hand around its X axis and activates each time it passes a half or quarter turn.
- Listed in Items, inventory and logic
- Inherits or implements
Mechanism - Nested types
RotationType - Documented in Other systems
Constructors
| Member | What it is |
|---|---|
Crank() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
7 private and internal fields
| Member | What it is |
|---|---|
private Transform ghostHandTransform | Transform of the grabbing hand's ghost hand, followed while turning. |
private Interactor interactor | The interactor turning the crank. |
private Quaternion lastDent | Crank rotation at the last activation. |
private Vector3 lastHandPosition | Hand position around the crank when grabbed. |
private Transform rotationRoot | Transform that is rotated on its X axis. |
private Collider[] tightGripColliders | Colliders used to re-check tight grip on the handle while turning. |
private Crank.RotationType type | Half or quarter turn per activation. |
Properties
1 private and internal property
Methods
| Member | What it is |
|---|---|
protected override IEnumerator CheckAction() (iterator) | Server coroutine: rotates the crank to follow the ghost hand each frame and calls OnActivated each time it turns past DentDistance. |
protected override void OnInteracted(Interactable interactable, Interactor interactor) | Stores the grabbing hand and its starting position around the crank. |