Rigidbody2D Set Velocity If Input Not Zero
Sets Rigidbody2D velocity only when the input magnitude is above a threshold.
Parameters
| Parameter | Description |
|---|---|
| Rigidbody2D | The Rigidbody2D to modify. |
| Input | Velocity to apply. |
| Threshold | Input magnitudes below this are treated as zero. |
Notes
- This is useful when you want to keep the current 2D velocity while there is no input.